# 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.

## 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 on other sites
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 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 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 on other sites

Thanks I'll try all this and also similar to what I've done on Linux a while ago:

http://stackoverflow.com/questions/9648943/static-compile-of-libcurl-apps-linux-c-missing-library

hence disabling stuff I don't neeed.

Visual Studio Command Prompt? I clicked start and typed dev. Then alike such came up to execute. Must be this.

If I run into more problems I'll get back later. Thanks.

##### Share on other sites

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

Edited by mike44

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632996
• Total Posts
3009778
• ### Who's Online (See full list)

There are no registered users currently online

×