2

I need to use a static library of libcurl and I found this github rep that generate the libraries.

Now, I'm trying to compile a simple piece of code that use curl using the static library, libcurl_a.lib, but without success.

At first, I miss the -DCURL_STATICLIB flag and I got some undefined reference errors:

undefined reference to `curl_easy_init'
undefined reference to `curl_easy_setopt'
undefined reference to `curl_easy_setopt'
undefined reference to `curl_easy_perform'
undefined reference to `curl_easy_strerror'
undefined reference to `curl_easy_cleanup'

The flag solve it, but now i got these ones:

unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll referenced in function _Curl_ftp_parselist
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__strtoll
unresolved external symbol __imp__GetTickCount64@0 referenced in function _curlx_tvnow
unresolved external symbol __imp__InitializeCriticalSectionEx@12 referenced in function _init_thread_sync_data
unresolved external symbol __ltod3 referenced in function _getinfo_double
unresolved external symbol __ltod3
unresolved external symbol __dtol3 referenced in function _Curl_pgrsUpdate
unresolved external symbol ___report_rangecheckfailure referenced in function _base64_encode

I'm stuck here and I don't know how to solve this unresolved external symbols.

Anybody can help me? Thanks

hmiguel
  • 343
  • 1
  • 4
  • 16
  • Hmmm, I would search the internet for "unresolved external symbol __imp__strtoll curl". But you have other techniques, use them. – Thomas Matthews Jun 20 '15 at 01:27

2 Answers2

0

It could be that you are linking against the wrong version of kernel32.lib. Do you make x64 build? If so, you need to correct your library path.

Vivian De Smedt
  • 1,019
  • 2
  • 16
  • 26
  • in my case; there were "..\..\..\lib\$(Configuration)\Kernel32.lib" at the library's additional dependencies, by removing it I let VS studio to find correct version of Kernel32.lib. – myalc Jan 07 '16 at 14:04
0

Solution:

There is a problem with github repository .bat file, only seems to work with most recent VS versions. I used an older one version of build.bat and worked fine.

For reference: Compiled with VS 2005.

hmiguel
  • 343
  • 1
  • 4
  • 16