Jump to content
14 hours ago, Mr_KoKa said:

Are you on windows, what IDE? I managed to compile curl under windows using dev-c++ code::blocks and visual studio, under linux it is probably matter of apt-get dev package.

 

7 hours ago, Dat Guy said:

Yes, there are. Which language do you want to use?

Same here, C++ and Visual Studio. Can't seem to find a good tutorial, is it really that difficult. I found a 20 minute video but I don't want to watch it for 20 minutes to then find it outs the wrong thing.

Link to comment
https://linustechtips.com/topic/781466-curl/#findComment-9856997
Share on other sites

Link to post
Share on other sites

1 hour ago, Dat Guy said:

I think he is looking for compilation of curl library, not example curl usage.

 

@mattonfire Download latest curl source from then unpack it and open winbuild\BUILD.WINDOWS.txt where are instructions that may help you some more. But to create curl library you would need to find Visual Studio command prompt Shell, press winkey and type "Native x64" or "Native x86". It should pop up, something like "x64 Native Tools Command Prompt for VS 2017". Pick one that match your target, so you will need either 32 or 64 bit library. You may right-click it and run as admin.

 

Then cd to the winbuild directory from the command prompt, and build library using nmake like:

 

nmake /f Makefile.vc mode=dll VC=14 MACHINE=x64

Which will build 64bit dll lib using vs140 platform toolset. You will find it in "builds" directory, there will be folder named like: "libcurl-vc14-x64-release-dll-ipv6-sspi-winssl" containing all you need, dll in bin and lib in lib and files you need to include in your app.

 

You may want build yourself debug version of library, andd DEBUG=yes option to nmake and it will create separate directory inside "builds" just like for release.

 

Then to use curl in your app you need to add directory where curl lib is at to libraries, add includes directory to includes and put the dll to the same directory where your exe is at.

 

To add library directory you need to look for "Linker -> General -> Additional Library Directories" in your solution properties.

To add include directory look for "C/C++ -> General -> Additional Include Directiories"

Link to comment
https://linustechtips.com/topic/781466-curl/#findComment-9857349
Share on other sites

Link to post
Share on other sites

2 hours ago, Mr_KoKa said:

I think he is looking for compilation of curl library, not example curl usage.

 

@mattonfire Download latest curl source from then unpack it and open winbuild\BUILD.WINDOWS.txt where are instructions that may help you some more. But to create curl library you would need to find Visual Studio command prompt Shell, press winkey and type "Native x64" or "Native x86". It should pop up, something like "x64 Native Tools Command Prompt for VS 2017". Pick one that match your target, so you will need either 32 or 64 bit library. You may right-click it and run as admin.

 

Then cd to the winbuild directory from the command prompt, and build library using nmake like:

 


nmake /f Makefile.vc mode=dll VC=14 MACHINE=x64

Which will build 64bit dll lib using vs140 platform toolset. You will find it in "builds" directory, there will be folder named like: "libcurl-vc14-x64-release-dll-ipv6-sspi-winssl" containing all you need, dll in bin and lib in lib and files you need to include in your app.

 

You may want build yourself debug version of library, andd DEBUG=yes option to nmake and it will create separate directory inside "builds" just like for release.

 

Then to use curl in your app you need to add directory where curl lib is at to libraries, add includes directory to includes and put the dll to the same directory where your exe is at.

 

2 hours ago, fizzlesticks said:

Use vcpkg.

I took the weak mans option, thanks Fizzle worked perfectly.

Link to comment
https://linustechtips.com/topic/781466-curl/#findComment-9858068
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×