LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-20-2009, 11:16 AM   #1
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Rep: Reputation: 16
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
 
Old 05-20-2009, 01:12 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Kunsheng View Post
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.
 
Old 05-20-2009, 02:38 PM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Recompile curl.lib as static one.
 
Old 05-20-2009, 09:21 PM   #4
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Alien_Hominid View Post
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
 
Old 06-06-2009, 07:04 AM   #5
fantas
Member
 
Registered: Jun 2007
Location: Bavaria
Distribution: slackware, xubuntu
Posts: 143

Rep: Reputation: 22
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
 
Old 06-07-2009, 06:34 PM   #6
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Original Poster
Rep: Reputation: 16
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 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Could I get rid of Cygwin.dll/Cygwin1.dll in program compiled under Cygwin ? Kunsheng Programming 1 05-17-2009 08:30 PM
curl: (1) Protocol https not supported or disabled in libcurl guest Linux - Software 1 05-01-2009 03:40 AM
libcurl & curl-config problems jz32300 Linux - Newbie 2 06-09-2006 01:25 PM
kylix stand alone application leosgb Programming 9 04-27-2005 12:45 PM
clweather curl libcurl Suse 9.2 acummings SUSE / openSUSE 1 01-01-2005 01:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration