User forums > Help
Using static libs of libcurl
Roog:
Hi,
I'm using C::B for my project in combination with MinGW. I've installed MinGW in C:\MinGW and everything is working well, untill I wanted to use libcurl for my project. I've compiled the code well, and everything is working from the command line.
In the commandline the following code works well:
--- Code: ---gcc -o simple simple.c -DCURL_STATICLIB -I ..\..\include -L ..\..\lib\ -lcurl -lws2_32 -lwinmm
--- End code ---
My libcurl map is in: C:\MinGW\libcurl
But in C::B, when I add the libcurl\includes to Search Directories compiler and libcurl\lib too the Search D. Linker, and libcurl.a, libcurldll.a, libws2_32.a and libwinmm.a to the linker itself I still have compiling errors:
zlib1.dll not found when I add libcurldll.a to the compiler and the following when I remove libcurlddl.a from the linker settings:
--- Code: ---Compiling: C:\MinGW\src\tb\simple.c
Linking console executable: C:\MinGW\src\tb\simple.exe
C:\MinGW\src\tb\simple.o:simple.c:(.text+0x2b): undefined reference to `_imp__curl_easy_init'
C:\MinGW\src\tb\simple.o:simple.c:(.text+0x51): undefined reference to `_imp__curl_easy_setopt'
C:\MinGW\src\tb\simple.o:simple.c:(.text+0x5e): undefined reference to `_imp__curl_easy_perform'
C:\MinGW\src\tb\simple.o:simple.c:(.text+0x6e): undefined reference to `_imp__curl_easy_cleanup'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
4 errors, 0 warnings
--- End code ---
How am I supposed to fix this?
MortenMacFly:
--- Quote from: Roog on October 24, 2009, 03:32:53 pm ---How am I supposed to fix this?
--- End quote ---
Enable full compiler logging (see my sig) and post again.
Roog:
With libcurldll.a linked:
--- Code: ---mingw32-gcc.exe -IC:\MinGW\include -IC:\MinGW\libcurl\include -c C:\MinGW\src\tb\simple.c -o C:\MinGW\src\tb\simple.o
mingw32-g++.exe -LC:\MinGW\lib -LC:\MinGW\libcurl\lib -o C:\MinGW\src\tb\simple.exe C:\MinGW\src\tb\simple.o C:\MinGW\libcurl\lib\libcurl.a C:\MinGW\lib\libws2_32.a C:\MinGW\lib\libwinmm.a C:\MinGW\lib\libcurldll.a
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings
Checking for existence: C:\MinGW\src\tb\simple.exe
Executing: C:\Program Files\CodeBlocks/cb_console_runner.exe "C:\MinGW\src\tb\simple.exe" (in C:\MinGW\src\tb)
Process terminated with status -1073741510 (0 minutes, 8 seconds)
--- End code ---
Without libcurldll.a linked remains the same.
Roog:
Anyone?
stahta01:
Wild guess try adding the same defines
--- Code: ----DCURL_STATICLIB
--- End code ---
Tim S.
PS: This is a topic for a beginner programing site.
Navigation
[0] Message Index
[#] Next page
Go to full version