Jump to content
  • Advertisement
ePitts

link curl statically

Recommended Posts

Hi

I forgot how I've linked in my shared lib curl statically. Now I get linker Errors like:

main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_curl_global_init" in Funktion "

after

#include <curl/curl.h>

I do

#ifdef _DEBUG
#pragma comment(lib, "libcurl_a_debug.lib")
#else
#pragma comment(lib, "libcurl_a.lib")
#endif

what did I Forget?

Many thanks

 

Share this post


Link to post
Share on other sites
Advertisement

1. Do not never ever use #pragma comment rather than define your dependencies in the build configuration/linker tab

2. Do you have included the output path of your static lib into the linker configuration and build the lib before building your dependent program?

Share this post


Link to post
Share on other sites

Seems I first Need to rebuild libcurl to have the matching version. Any ideas on how to build statically libcurl without any dependencies on Win10? 

Thanks

Share this post


Link to post
Share on other sites

The included visual studio projects have a ton of options to pick from:

KINo6LW.png

And you end up with something like: curl\builds\libcurl-vc14-x64-release-static-ipv6-sspi-winssl\lib\libcurl_a.lib

Share this post


Link to post
Share on other sites
Posted (edited)

Yes I saw this. I don't need openssl or any other stuff. What should I pick for a static build to include in my shared lib? Thanks

ps: I'll try the libssh2 of your Picture and see if that's static.

Edited by ePitts

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!