Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » winsock lib not found / working
winsock lib not found / working [message #124835] Sat, 23 October 2004 10:47 Go to next message
Eclipse UserFriend
Originally posted by: eclipse.johnchamberlain.com

Hello, I cannot link the libcurl library (3rd party TCP support) when
using the eclipse CDT. I am using gcc to compile. Even though I included
the wsock libs the linker is reporting it cannot find them (compiling
works fine), here is the linker error:

Building target: OCAPI.exe
gcc -static -L"D:\apps\dev\libcurl\curl-7.12.1\include"
-L"D:\apps\dev\libcurl\curl-7.12.1\lib\.libs"
-L"D:\apps\dev\libcurl\curl-7.12.1\lib" -oOCAPI.exe error.o interactive.o
main.o utility.o -lwsock32 -lws2_32 -lmswsock -lcurl
D:\apps\dev\libcurl\curl-7.12.1\lib\.libs\libcurl.a(easy.o)( .text+0x26):
In function `win32_init':
d:/apps/dev/libcurl/curl-7.12.1/lib/easy.c:109: undefined reference to
`WSAStartup@8'

etc... [after this are a lot of other wsock-related link errors]

I have checked and WSAStartup@8 is definitely in the wsock32.a lib file so
why isn't it linking?

Thanks for any assistance, John C.
Re: winsock lib not found / working [message #124873 is a reply to message #124835] Sun, 24 October 2004 03:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dejan.nu6.org

Is the directory holding wsock32.a in library search path?

--
Dejan Lekic
developer, sysadmin and DBA
http://dejan.lekic.org
Re: winsock lib not found / working [message #124909 is a reply to message #124873] Sun, 24 October 2004 14:09 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.johnchamberlain.com

Dejan Lekic wrote:

> Is the directory holding wsock32.a in library search path?

Yes, if the library was not there, then the linker would have given an
error to that effect.

I have found the apparent cause of my problem: in the original linker
command I was using the option -static which prevents linking with dynamic
libraries. Also, for those with a similar problem in using libcurl the
ws2_32.a and mswsock libs were unnecessary. A working linker command looks
like this (eclipse CDT with mingw runnning on Windows):

gcc -L"D:\apps\dev\libcurl\curl-7.12.1\include"
-L"D:\apps\dev\libcurl\curl-7.12.1\lib\.libs"
-L"D:\apps\dev\libcurl\curl-7.12.1\lib" -oOCAPI.exe error.o interactive.o
main.o utility.o -lwsock32 -lcurl

I think the reason for my problem was possibly that you cannot statically
link to winwock? I'm not sure.

In any case another note is that libcurl apparently requires a dll called
libcurl-3.dll to be in directory with your executable (or in the path) to
run.
Previous Topic:compiler
Next Topic:Updating project...
Goto Forum:
  


Current Time: Sat Jul 12 07:04:42 EDT 2025

Powered by FUDForum. Page generated in 0.23864 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top