Running Windows 7 64-bit (Intel i5 64bit).
I remember setting up Visual Studio 2017 Community for 32-bit.
(I assumed this would give my apps backwards compatibility and also run on 64 bit machines, maybe a bad assumption?).
In any case, to confirm, the advanced linker settings are targeting x86... as well as the build configurations targeting 32bit, x86.
My app (C++ with Boost) has been compiling and running fine.
Now I am trying to add cURL but not looking so good.
Steps Attempted to compile cURL as 32 bit:
- c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build>vcvarsall.bat x86
- nmake /f Makefile.vc mode=static MACHINE=x86
(also tried linking static C CRT with RTLIBCFG=static, no difference)
Additional Include Directories: added path to /include dir
Preprocessor Definitions: added CURL_STATICLIB
- Additional Library Directories: added path to /lib
- Additional Dependencies: added libcurl_a.lib
The cURL function in this sample linked:
CURL *curl = curl_easy_init();
if (curl) printf("curl_easy_init() succeeded!\n");
else fprintf(stderr, "Error calling curl_easy_init().\n");
return 0;
but at the very end of the compile"
fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
VCTargets\Microsoft.CppCommon.targets(720,5): error MSB6006: "link.exe" exited with code 1112.
UPDATE: Linker Advanced Setting was not set back to x86 after trying below links, the true error is:
fatal error LNK1120: 60 unresolved externals
they all look like this but for each object file referenced:
libcurl_a.lib(easy.obj) : error LNK2019
(FYI - I did try these and build cURL as if I were targeting x64, but the functions (in the sample code) would not resolve during linking.)