tags:

views:

69

answers:

2

Hi there,

I've tried using curllib, but find my dll becomes dependent on curllib.dll. Is there another method I can investigate and use? I simply want to make a request to a web page. My dll has to be independant so it can be distributed on its own.

Thanks

+2  A: 

The libcurl library comes as both a DLL and as a static library - if you don't want dependencies on the DLL, link with the static library - it's called libcurl.a, and can be found in the lib directory of the libcurl Windows distribution. Note that you may also need to explicitly link against some or all of the other libraries in this directory, depending on what your code actually does.

anon
Thanks for the reply, that's interesting. I tried using the static library earlier today and just got link errors. The linking issue from what I've seen is a whole new thread.Can I ask, is it as simple as updating my link library to point at the static lib folder or do I need to set my project up differently?
Haraldo
@Haraldo which compiler are you using?
anon
Using VS2008 express
Haraldo
I think that you need to define LIBCURL_STATIC or something like that. Look in the curl.h include file.
Zan Lynx
Here it is: CURL_STATICLIB. Put that definition in your project file.
Zan Lynx
@Haraldo Can't help you with VS stuff, I'm afraid.
anon
Hi Zan, I currently have it set as a preprocessor definition for all configurations. I will attempt to link to a static lib folder also which contains the *.a files. Thanks
Haraldo
Thanks Neil you've pointed me in the right direction.
Haraldo
Not much success so far - also I've been advised not to use *.a files as they're for Mingw-32/GCC (whatever that is!). My dll, even though it's compiled it's still dependant on CURLLIB.DLL and MSVCR90D.DLL. If anyone can suggest how I make my dll independent, It would be much appreciated.
Haraldo
A: 

For anyone in a similar situation I managed to compile the libcurl visual studio project in the latest curl distribution with Runtime library set to Multi-threaded dll. I think I left everything else the same apart from the output files (debug/release respectfully). Once the lib compiled with my dll I noticed now my dll is only dependant on 3 other dlls.

  • IESHIMS.dll - which I fixed with an environment variable path update (program files(x86)/Internet Explorer
  • MSVCR90.DLL
  • GPSVC.DLL.

I fear now its a Win7 64 bit issue. At least I got my dll working with no libcurl dependency, right!?

Haraldo