cURL / Mailing Lists / curl-library / Single Mail

curl-library

Linking problems using libcurl with Visual C++ 2005: “unresolved external symbol __imp__curl_easy_setopt”

From: Parthasarathi Ilangovan <rajajiitesh_at_gmail.com>
Date: Tue, 9 Mar 2010 19:41:27 +0530

I am planning to use libcurl in my project. I had downloaded the library
source,built and integrated it in a small POC application. I am able to
build and run the application without any issues with the generated
libcurl.dll and libcurl_imp.lib files. Now when I integrate the same library
in my project I am getting linker errors.

6>foo.obj : error LNK2001: unresolved external symbol _imp_curl_easy_setopt

6>foo.obj : error LNK2001: unresolved external symbol _imp_curl_easy_perform

6>foo.obj : error LNK2001: unresolved external symbol _imp_curl_easy_cleanup

6>foo.obj : error LNK2001: unresolved external symbol _imp_curl_global_init

6>foo.obj : error LNK2001: unresolved external symbol _imp_curl_easy_init
I have researched and tried all manners of workarounds like adding
CURL_STATICLIB definitions , additional libraries , changing to /MT even
copying the libs to the release directory but nothing seems to work. As far
as I can see the only difference between approach #1 and #2 in my steps are
#1 is an console application using the libcurl.dll while in my main project
this is another dll which is trying to link to libcurl.dll.. Would that
necessitate any change in approach? Can I use the same generated multi
threaded DLL /MD file for both(Tried /MT also with no success)? Any other
ideas?

I tried setting all properties to mirror the other DLLs in the project but
no use. Its been nearly two weeks and I am running out of ideas so please
help!!

I tried the FAQ listings already but either they address a different
problem(static linking) or does not help me.

Following are the linker options.

-------------------------------------------------Working-------------------------------------------------

/OUT:"C:\SampleFTP\Release\SampleFTP.exe" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"C:\SampleFTP\SampleFTP\Release" /MANIFEST
/MANIFESTFILE:"Release\SampleFTP.exe.intermediate.manifest" /DEBUG
/PDB:"c:\SampleFTP\release\SampleFTP.pdb" /SUBSYSTEM:CONSOLE /OPT:REF
/OPT:ICF /LTCG /MACHINE:X86 /ERRORREPORT:PROMPT libcurl_imp.lib kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

-------------------------------------------------Working-------------------------------------------------

----------------------------------------------NotWorking-------------------------------------------------

/OUT:".......\nt\Win32\Release/foo__tests.dll" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"C:\FullLibPath\libcurl_libs" /LIBPATH:"......\nt\Win32\Release"
/DLL /MANIFEST
/MANIFESTFILE:".\foo_tests\Win32\Release\foo_tests.dll.intermediate.manifest"
/DEBUG /PDB:".......\nt\Win32\Release/foo_tests.pdb" /OPT:REF /OPT:ICF /LTCG
/IMPLIB:".......\nt\Win32\Release/foo_tests.lib" /MACHINE:X86
/ERRORREPORT:PROMPT odbc32.lib odbccp32.lib util_process.lib wsock32.lib
Version.lib libcurl_imp.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib "......\nt\win32\release\otherlib1.lib"
"......\nt\win32\release\otherlib2.lib"
----------------------------------------------NotWorking-------------------------------------------------

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-09