954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problems with linking OBJ files

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

#include
#include
#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

ramow
Newbie Poster
2 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Try wsock32.lib.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
Try wsock32.lib.

Thx Pal. I think it worked.....
Love ya man. I have been stuck with this for 1 week....
Take care
bye

ramow
Newbie Poster
2 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You