How compile program with curl support?

Ivan Kazmenko gassa at mail.ru
Thu Aug 22 03:00:18 PDT 2013


On Thursday, 22 August 2013 at 07:28:52 UTC, ilya-stromberg wrote:
> undefined reference to `curl_global_init'
> undefined reference to `curl_global_cleanup'
>
> What should I do to get curl support?
> OS is Linux Ubuntu 12.10.

I recently had the same problem on Windows (thread: 
http://forum.dlang.org/thread/wdmqzyqoowrhqfpwduej@forum.dlang.org). 
  It boiled down to the following: the lib file contained 
functions named like "curl_global_init" but the linker searched 
for "_curl_global_init" (starting with underscore).  I don't have 
OSX available, but the OSX file libcurl.a I downloaded contains 
underscored names and your linker searches for non-underscored 
ones, so that may be an inverse problem.  Unless some OS-specific 
linking magic is supposed to take care of that in your case.

On Windows, I changed the way to produce libcurl D bindings from
implib.exe curl.lib libcurl.dll
to
implib.exe /system curl.lib libcurl.dll
and then I link
in order to introduce the underscores.  Clearly I'm not an 
expert, but this may mean you could find a way to [re]produce the 
bindings library on your side as well.

Ivan Kazmenko.


More information about the Digitalmars-d-learn mailing list