LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Could I get rid of libcurl.dll and compile a stand-lone application with Curl? (https://www.linuxquestions.org/questions/programming-9/could-i-get-rid-of-libcurl-dll-and-compile-a-stand-lone-application-with-curl-727309/)

Kunsheng 05-20-2009 11:16 AM

Could I get rid of libcurl.dll and compile a stand-lone application with Curl?
 
Hello everyone,

I am compiling a program that is using Curl library under Windows XP.

My compiler is Visual Studio 2005, the only thing bothers is that the executable does require libcurl.dll and some other related-dlls to be under /windows/system32.

I am not sure whether there is someway to combine those dlls together into an stand-alone executable or it is impossible because of licience.

I am good with both but do need some reference to prove it.

Thanks for any help,


-Kun

Sergei Steshenko 05-20-2009 01:12 PM

Quote:

Originally Posted by Kunsheng (Post 3547096)
Hello everyone,

I am compiling a program that is using Curl library under Windows XP.

My compiler is Visual Studio 2005, the only thing bothers is that the executable does require libcurl.dll and some other related-dlls to be under /windows/system32.

I am not sure whether there is someway to combine those dlls together into an stand-alone executable or it is impossible because of licience.

I am good with both but do need some reference to prove it.

Thanks for any help,


-Kun


The license is BSD, isn't it ? I.e. all you are required to do is "pay tribute", i.e. to mention that your app uses CURL, but you do not have to distribute the source.

Alien_Hominid 05-20-2009 02:38 PM

Recompile curl.lib as static one.

Kunsheng 05-20-2009 09:21 PM

Quote:

Originally Posted by Alien_Hominid (Post 3547318)
Recompile curl.lib as static one.


thanks. Could you give me some more details ? I did compile the library myself and got .lib and .dll file. I linked the lib in Visual Studio 2005, but it require the .dll file be under system folder. Is that dynamic dll ? Or how could I compile a static one ?


Thanks a lot,

-Kun

fantas 06-06-2009 07:04 AM

I don't know for Visual Studio, but I successfully compiled a static library under Mingw32 with a basic feature set. Just in case, here are the needed steps (also for someone new to Mingw):

[Mingw / MSYS]
- download Mingw package and install/unzip
- add the Mingw bin directory path to the PATH variable
- download MSYS (from Mingw's sourceforge repository)

[Build]
- run MSYS
- type cd <your_curl_directory> (replace accordingly)
- type ./configure --enable-shared=no --without-ssl --without-zlib --without-libidn
--enable-http --enable-ftp --enable-ipv6
(script will run for a while, so grab a cup of coffee)
- type make
- now you should find the libcurl.a static library in the .lib directory
- copy it somewhere
- type make distclean (will clean up the temporary files left from the build)

Hope this helps,
f

Kunsheng 06-07-2009 06:34 PM

Thanks, man. I tried it and it works!

I finally have to get rid of MinGW and libcurl since I have to use some other things like PCRE and Tidy, which could be compiled under VC easily.

Right now I used WinInet to replace libcurl in my app.

Sure this post helps future comers.


-Kun


Quote:

Originally Posted by fantas (Post 3565117)
I don't know for Visual Studio, but I successfully compiled a static library under Mingw32 with a basic feature set. Just in case, here are the needed steps (also for someone new to Mingw):

[Mingw / MSYS]
- download Mingw package and install/unzip
- add the Mingw bin directory path to the PATH variable
- download MSYS (from Mingw's sourceforge repository)

[Build]
- run MSYS
- type cd <your_curl_directory> (replace accordingly)
- type ./configure --enable-shared=no --without-ssl --without-zlib --without-libidn
--enable-http --enable-ftp --enable-ipv6
(script will run for a while, so grab a cup of coffee)
- type make
- now you should find the libcurl.a static library in the .lib directory
- copy it somewhere
- type make distclean (will clean up the temporary files left from the build)

Hope this helps,
f



All times are GMT -5. The time now is 11:09 PM.