Jump to content
  • Advertisement
Sign in to follow this  
mike44

Unity compile curl for x64

This topic is 592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi

I've been trying all day to compile curl on my new Windows10 after installing visual studio community 2015. Link errors like about curl_global_init in my app in which i want to statically link curl.

Hence with all these x86 errors, I guess I need to compile curl for x64? Following this:

http://www.codepool.biz/build-use-libcurl-vs2015-windows.html

How, this is what I get:

D:\CPP-Win\curl-7.53.1\winbuild>nmake /f Makefile.vc mode=static VC=14 MACHINE=x64 DEBUG=no

 

..\builds\libcurl-vc14-x64-release-static-ipv6-sspi-winssl-obj-lib/file.obj : fatal error LNK1112: Modul-Computertyp "X86" steht in Konflikt mit dem Zielcomputertyp "x64".
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe"": Rückgabe-Code "0x458"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"": Rückgabe-Code "0x2"
Stop.
 

Do I need to install something? Couldn't find anything for vs community edition.

Thanks

 

Share this post


Link to post
Share on other sites
Advertisement
Try running the build from a Visual Studio Command Prompt (it should be in the same folder as your VS 2015 install on the Start menu).

Share this post


Link to post
Share on other sites

Modul-Computertyp "X86" steht in Konflikt mit dem Zielcomputertyp "x64"
A module's target conflicts with the build target. Now of course, it would be immensely helpful if they told you which one. Duh.

Thanks to the linker not letting us know which file this is about, we need to walk into let's-make-a-guess-land. :(

Looking at the makefile, you will find that everything you compile is built for X64 (both because you explicitly specify the target, and because it defaults to the native architecture, too). So... the problem is demonstrably not with file.c (or file.obj, respectively) which the linker deceptively shows (it's probably just the first object file it touched), but something that you didn't compile but link with, which is a 32 bit version when it shouldn't be. Now, to make your life extra easy, the libs you link with do not appear to be anywhere.

Looking into Makefile.vc14 in the lib subdirectory, you find a lengthy list of configurations which link with different libraries according to what you specified. You specified winssl, so let's look what  the section under  # release-winssl has to say:

LNK      = $(LNKLIB) $(WINSSLLIBS) /out:$(DIROBJ)\$(TARGET)

Looks good, doesn't it. But, just out of curiosity... what do these translate to? Look a couple of lines above, and you find:

LNKLIB       = link.exe /lib
WINSSLLIBS   = crypt32.lib

So we are finally calling link.exe /lib crypt32.lib something something. The "32" is a red herring, since the library is ingeniously called crypt32 under both 32 and 64 bit. However, chances are good that the one under /lib is not the one you want.

That's my excursion into let's-make-a-guess-land.

Share this post


Link to post
Share on other sites

You might have better luck using the VS solutions in the curl-XXX/projects/Windows/ directory and compiling for the static LIB configurations. 

The last time I did this was a few years ago so maybe things have changed.  Anyway I compiled with Windows Secure Channel for SSL (see https://curl.haxx.se/docs/ssl-compared.html) and add the following to Preprocessor Definitions:

USE_SCHANNEL

USE_WINDOWS_SSPI

HTTP_ONLY
 
This worked and added only 100K or so to the executable size.  Using OpenSSL also worked but add a megabyte.
 
Good luck!   

Share this post


Link to post
Share on other sites

Solved by disabling stuff and using the x64 dev. prompt.

Edited by mike44

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!