943,940 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3090
  • C RSS
Jul 25th, 2005
0

Problems with linking OBJ files

Expand Post »
Hi everyone,
i am havinh problems linking OBJ files that uses the following:

#include <stdio.h>
#include <winsock2.h>
#pragma comment(lib, "ws2_32")

I am working on MEX matlab files.
When i link them, i get the following errors:

>> mex timestwomex.c C:\MATLAB6p5\sys\lcc\lib\ws2_32.lib

timestwomex.obj .text: undefined reference to '_gethostbyname@4'
timestwomex.obj .text: undefined reference to '_getsockname@12'
timestwomex.obj .text: undefined reference to '_inet_ntoa@4'

C:\MATLAB6P5\BIN\WIN32\MEX.PL: Error: Link of 'timestwomex.dll' failed.

N.B: I use the mex compiler and linker on windowsXP.

Thanks,
Ramow
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ramow is offline Offline
2 posts
since Jul 2005
Jul 25th, 2005
0

Re: Problems with linking OBJ files

Try wsock32.lib.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 25th, 2005
0

Re: Problems with linking OBJ files

Quote originally posted by Narue ...
Try wsock32.lib.
Thx Pal. I think it worked.....
Love ya man. I have been stuck with this for 1 week....
Take care
bye
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ramow is offline Offline
2 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Help with Pointer and While loop Please
Next Thread in C Forum Timeline: Using Assembly Codes in Bloodshed Dev-CPP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC