Ok, doing an old VC project did not work, so I tried based on the documentation discussing the winbuild folder and directly running the nmake /f Makefile.vc... and STILL get unresolved externals. This SHOULD NOT be this difficult on such a widely used and maintained system. All from a brand-new fresh download as of today.
I am using VS2013 command line prompt and from capturing the output via > redirection to text file and 2> redirecting error content I get
nmake /f Makefile.vc mode=dll VS=12 > compileResult.txt 2> compileError.txt
(Error content)
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.exe"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
(Rest of the build content)
configuration name: libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl
Using SSL:
Using SSH2:
Using ZLIB:
Using IDN: true
Using IPv6: true
Using SSPI: true
Using SPNEGO: true
Using WinSSL: true
CFLAGS: /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /I"../../deps/include" /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES /DUSE_IPV6 /DUSE_WINDOWS_SSPI /DUSE_SCHANNEL /DHAVE_SPNEGO
LFLAGS: /nologo /machine:x86 "/LIBPATH:../../deps/lib"
GenPDB:
Debug:
Machine: x86
link.exe /DLL ws2_32.lib wldap32.lib advapi32.lib Normaliz.lib /out:..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib\libcurl.dll /IMPLIB:..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib\libcurl.lib /nologo /machine:x86 "/LIBPATH:../../deps/lib" ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/file.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/timeval.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/base64.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hostip.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/progress.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/formdata.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/cookie.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/sendf.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/ftp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/url.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/dict.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/if2ip.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/speedcheck.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/ldap.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/version.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/getenv.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/escape.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/mprintf.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/telnet.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/netrc.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/getinfo.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/transfer.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/strequal.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/easy.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/security.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_fnmatch.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/fileinfo.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/ftplistparser.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/wildcard.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/krb5.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/memdebug.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http_chunks.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/strtok.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/connect.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/llist.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hash.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/multi.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/content_encoding.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/share.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http_digest.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/md4.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/md5.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http_negotiate.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/inet_pton.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/strtoofft.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/strerror.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/amigaos.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hostasyn.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hostip4.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hostip6.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hostsyn.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/inet_ntop.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/parsedate.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/select.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/tftp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/splay.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/strdup.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/socks.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/ssh.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/rawstr.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_addrinfo.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/socks_gssapi.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/socks_sspi.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_sspi.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/slist.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/nonblock.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_memrchr.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/imap.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/pop3.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/smtp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/pingpong.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/rtsp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_threads.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/warnless.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hmac.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_rtmp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/openldap.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_gethostname.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/gopher.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/idn_win32.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http_negotiate_sspi.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http_proxy.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/non-ascii.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/asyn-ares.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/asyn-thread.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_gssapi.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_ntlm.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_ntlm_wb.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_ntlm_core.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_ntlm_msgs.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_sasl.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/curl_multibyte.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/hostcheck.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/bundles.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/conncache.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/pipeline.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/dotdot.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/x509asn1.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/http2.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/openssl.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/gtls.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/vtls.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/nss.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/qssl.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/polarssl.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/polarssl_threadlock.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/axtls.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/cyassl.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/curl_schannel.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/curl_darwinssl.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib/vtls/gskit.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib\libcurl.res
Creating library ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib\libcurl.lib and object ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-lib\libcurl.exp
Copying libs...
link.exe /incremental:no /libpath:"..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl\lib" /nologo /out:..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl\bin\curl.exe /subsystem:console /machine:x86 libcurl.lib ws2_32.lib wldap32.lib advapi32.lib Normaliz.lib ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl\tool_hugehelp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl\nonblock.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl\rawstr.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl\strtoofft.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_binmode.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_bname.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cb_dbg.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cb_hdr.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cb_prg.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cb_rea.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cb_see.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cb_wrt.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_cfgable.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_convert.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_dirhie.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_doswin.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_easysrc.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_formparse.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_getparam.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_getpass.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_help.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_helpers.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_homedir.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_libinfo.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_main.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_metalink.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_mfiles.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_msgs.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_operate.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_operhlp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_panykey.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_paramhlp.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_parsecfg.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_setopt.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_sleep.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_urlglob.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_util.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_vms.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_writeenv.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_writeout.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl/tool_xattr.obj ..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl-obj-curl\curl.res
tool_cb_rea.obj : error LNK2019: unresolved external symbol _curlx_read referenced in function _tool_read_cb
..\builds\libcurl-vc12-x86-release-dll-ipv6-sspi-spnego-winssl\bin\curl.exe : fatal error LNK1120: 1 unresolved externals
The instructions you used are actually very old. I don't know if those VS workspaces are actively maintained, and there is a newer makefile that the developers encourage people to use for command-line builds (see this thread in the curl mailing list: http://curl.haxx.se/mail/lib-2014-03/0220.html).
If you look in the curl source directory, there is a subdirectory called winbuild. I can usually build curl and libcurl successfully with the makefile in there, Makefile.vc. The options are clearly explained in the file BUILD.WINDOWS.txt. A basic build command might look something like:
C:\curl-src\winbuild> nmake -f Makefile.vc MODE=dll VC=12 MACHINE=x64
That will produce a "builds" folder in the curl source directory, which will have your curl.exe, libcurl.dll, and libcurl.lib. If you choose MODE=static, you will not get a libcurl.dll, but you will get libcurl_a.lib, which might be what you need for your project.
You can add the binaries and libs to you your VS project. You also might need to add the .h files from the curl include directory, and any other source files you want.
For curl 7.36.0, there was a small problem in the makefile, which the developers quickly corrected. You can get the updated makefiles from the GitHub repository in Daniel Stenberg's comment below. Simply replace the makefiles in the winbuild directory of the release package with the makefiles from the windbuild directory in the GitHub repo before building.
Hope that helps.
Related
I want to use Visual Studio 2019 to build GDAL. But I keep getting errors when trying to build.
The computer I'm using is Acer Aspire f 15 F5573G-72CP,
CPU is i7 7500U 2.7GHz, RAM is 16GB, OS is Windows 10 64 bit
Steps I've taken are:
Download Visual Studio Community, included .NET desktop development, Universal Windows Platform development, Desktop development with C++ and Node.js development.
Used GIT BASH from git for windows to pull the repo https://github.com/OSGeo/GDAL.git and located it c:/gdal
in c:/gdal/GDAL/nmake.opt:
3.a. changed line 42 to Line 42: MSVC_VER=1926
3.b. I uncommented line 260:
Line 259: # PROJ stuff (required dependency: PROJ >= 6)
Line 260: PROJ_INCLUDE = -Id:\install-proj\local\include
3.c. Uncommented line 213: Line 213: WIN64=YES
Also pulled the repo: https://github.com/OSGeo/PROJ.git located at c:/proj/PROJ
Using Windows Powershell, cd c:/gdal/gdal -> generate_vcxproj.bat 16.0 64 gdal_vs2019
which outputs the following:
PS C:\gdal\gdal> .\generate_vcxproj.bat 16.0 64 gdal_vs2019
The system cannot find the path specified.
Generating:
"C:\gdal\gdal\gdal_vs2019.vcxproj"
"C:\gdal\gdal\gdal_vs2019.vcxproj.user"
"C:\gdal\gdal\gdal_vs2019.vcxproj.filters"
"C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj"
"C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj.user"
"C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj.filters"
This might take a little while...
Projects done!
Launch Visual Studio IDE
* Open project "C:\gdal\gdal\gdal_vs2019.vcxproj"
* Add project "C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj"
* Configure Build Dependencies to build the main project before the test project.
* Save solution in .sln file
Done!
PS C:\gdal\gdal>
Open Visual Studio 2019, open a project or solution, select C:\gdal\gdal\gdal_vs2019.vcxproj, ensure Solution Platforms dropdown is set to x64, Build->Build Solution, which returns three errors:
Severity Code Description Project File Line Suppression State
Error U1077 'call' : return code '0x1' gdal_vs2019 C:\gdal\gdal\NMAKE 1
Severity Code Description Project File Line Suppression State
Error U1077 '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\nmake.EXE"' : return code '0x2' gdal_vs2019 C:\gdal\gdal\NMAKE 1
Severity Code Description Project File Line Suppression State
Error MSB3073 The command "chcp 65001 >NUL && nmake -f makefile.vc MSVC_VER=1926 WIN64=1 DEBUG=1 WITH_PDB=1" exited with code 2. gdal_vs2019 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 46
The Output tab shows:
1>------ Build started: Project: gdal_vs2019, Configuration: Debug x64 ------
1>
1>Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> cd port
1> nmake /nologo /f makefile.vc
1> call prev_dllbuild.bat
1>The system cannot find the path specified.
1>
1>C:\gdal\gdal\port>IF NOT EXIST dllbuild.prev (ECHO 1 ) 1>dllbuild.prev
1>
1>C:\gdal\gdal\port>SET /P PREV_DLLBUILD= 0<dllbuild.prev
1>
1>C:\gdal\gdal\port>IF NOT "1" == "1" (ECHO 1 ) 1>dllbuild.prev
1>NMAKE : fatal error U1077: 'call' : return code '0x1'
1>Stop.
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\nmake.EXE"' : return code '0x2'
1>Stop.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command "chcp 65001 >NUL && nmake -f makefile.vc MSVC_VER=1926 WIN64=1 DEBUG=1 WITH_PDB=1" exited with code 2.
1>Done building project "gdal_vs2019.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How should I address these errors to get GDAL built successfully?
This is a little late, but have you tried the following:
Read https://trac.osgeo.org/gdal/wiki/BuildingOnWindows
Read https://trac.osgeo.org/gdal/wiki/BuildHints for specific
needs/dependencies/drivers
Get all the dependencies you need
Edit nmake.opt to disable/enable features/drivers you don't
need
Run NMAKE
You could also try cleaning:
nmake /f makefile.vc clean
nmake /f makefile.vc
Finally, you could try building on a different computer.
Hark, this is the way one should ask questions: clear, precise steps, detailed description. Very helpful!
I could compile when I didn't use the GIT repo. Instead I downloaded PROJ following their Windows installation documentation:
The simplest way to install PROJ on Windows is to use the OSGeo4W_
software distribution. OSGeo4W provides easy access to many popular
open source geospatial software packages. After installation you can
use PROJ from the OSGeo4W shell. To install PROJ do the following:
note::
If you have already installed software via OSGeo4W on your computer, or if
you have already installed QGIS on your computer, it is likely that PROJ is
already installed. Type "OSGeo4W Shell" in your start menu and check whether
that gives a match.
Download either the 32 bit or 64 bit installer.
Run the OSGeo4W setup program.
Select "Advanced Install" and press Next.
Select "Install from Internet" and press Next.
Select a installation directory. The default suggestion is fine in most cases. Press Next.
Select "Local package directory". The default suggestion is fine in most cases. Press Next.
Select "Direct connection" and press Next.
Choose the download.osgeo.org server and press Next.
Find "proj" under "Commandline_Utilities" and click the package in the "New" column until the version you want to install appears.
Press next to install PROJ.
I downloaded the installers from osgeo4W. Because I needed both 32 and 64 bit versions I downloaded osgeo4w-setup-x86-v1.exe and osgeo4w-setup-x86_64-v1.exe. The download got stuck after 25% when downloading the big proj-file from osgeo, so I selected the oslandia download link instead. This initially fails (at least for me), but after restart it could finish.
In the download package selection click on the "Skip" logo to select binary ("B") and source ("S"). I selected both. I downloaded "proj", "proj-dev" and "proj-dev-data", not sure what is actually neeeded. When it asked to include dependencies (a lot), I selected to include them.
In the nmake.opt (your step 3) I used for the 32 bit:
PROJ_INCLUDE = -IC:\OSGeo4W\include
PROJ_LIBRARY = C:\OSGeo4W\lib\proj.lib
and for the 64 bit:
PROJ_INCLUDE = -IC:\OSGeo4W64\include
PROJ_LIBRARY = C:\OSGeo4W64\lib\proj.lib
For running the generate_vcxproj.bat, I used Visual Studio 2022 x86 and x64 native tool command prompts. In the bat-file I changed:
if "%_vcver_%"=="16.0" (
set _clver_=1926
set _vstoolset_=v143
And in the nmake.opt:
MSVC_VER=1929
I run the bat separately for 64 and 32 bits:
generate_vcxproj.bat 16.0 64 gdal_vs2022
generate_vcxproj.bat 16.0 32 gdal_vs2022_x86
After this step I could open the vcxproj-files in Visual Studio and compile the libraries. I used the genererated gdal_i.lib's and accompanying gdal303.dll's in my project.
I'm trying to deploy my Django website, which is written using Python 2.7, on a windows 64 bit machine (Windows Server 2008 R2). I installed the pre-compiled version of Apache (Apache 2.4.16 x64) from https://www.apachehaus.com/cgi-bin/download.plx (due to lack of option provided by Apache Lounge***), and have checked that Python 2.7 runs on 64 bit and compiles with VC9. I wasn't able to find a pre-built binary for mod_wsgi (for Windows 64 bit and compiled with VC9), so I downloaded the source code for mod_wsgi from https://github.com/GrahamDumpleton/mod_wsgi/releases/tag/4.4.13 and followed the direction from https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst, changing the ap24py27-win64-VC9.mk file to point at the right directories for APACHE_ROOTDIR and PYTHON_ROOTDIR, and using C++ 2008 64-bit Command Prompt to run the command nmake -f ap24py27-win64-VC9.mk clean. However, this gave me the error:
wsgi_memory.obj : error LNK2019: unresolved external symbol GetProcessMemoryInfo referenced
in function getPeakRSS
mod_wsgi.so : fatal error LINK1120: 1 unresolved externals
NMAKE : fatal error U1077: `"...\Visual C++ for Python\9.0\VC\Bin\amd64\c1.EXE"` :
return code `0x2`
Stop.
I have read the installation and configuration documents for mod_wsgi multiple times and have searched the web including SO for the past few hours to no avail. What am I doing wrong here and how could I fix it?
***I know the official document for installing mod_wsgi warns against using binaries from other sources than Apache Lounge but I don't seem to be able to find the right compiled version (for VC9 and Windows 64 bit) from the site. Could this be a problem and if so, how could I fix it?
Update: following Adelin's suggestion, I was able to get namke -f ap24py27-win64-VC9.mk clean to run. However, when I try running namke -f ap24py27-win64-VC9.mk or namke -f ap24py27-win64-VC9.mk install, I get pages of warnings that say: warning C4820: '...' : '...' bytes padding added after data member '...' until the compiler quits with
fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
...\mod_wsgi-4.4.13\src\server\wsgi_memory.c<124> : warning C4711: function 'getCurrentRSS' selected for automatic inline expansion
NMAKE: fatal error U1077: '"C:\...\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\c1.EXE"' : return code '0x2'
Stop.
Does anyone have any idea why this might be and how I should go about fixing it?
I had this same error.
The problem is that the cl.exe doesn't find the psapi.lib. This lib includes the function referenced in wsgi_memory.c - GetProcessMemoryInfo.
To fix this, you should follow these steps:
Locate psapi.lib (run a search on C:\)
Open the ap24py27-win64-VC9.mk file you are using to compile, with
any text editor
See what other .mk file it includes. Most probably common-VC9.mk
Open that file (common-VC9.mk) with any text editor
Under LDFLAGS, append yet another line of /LIBPATH:"PATH_FOUND_AT_STEP_1"\
Save changes and retry
What a pain in the ass this was for me too :)
P.S. If you don't find psapi.lib anywhere, it's because you don't have the Windows SDK. I installed both Windows 7 and Windows 8 SDKs and eventually had the psapi.lib located here C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64
Edit:
To give you a solution for your newest errors in a somewhat general way, whenever nmake throws "No such file" errors, the location for the file is not properly referenced in common-VC9.mk file.
There are two types of files nmake will look for: .h or .lib.
If a .h is not found, the corresponding path should be properly referenced under the CPPFLAGS variable of common-VC9.mk file.
If a .lib is not found, you need to update LDFLAGS path accordingly.
How? The same way you included the path for psapi.lib: locate the file and append the corresponding path to the proper variable: CPPFLAGS or LDFLAGS.
I try to compile a driver for WinXP x86 Release, using these commands:
C:\WinDDK\7600.16385.0\bin\setenv.bat C:\WinDDK\7600.16385.0\ fre x86 WXP no_oacr
cd C:\src
build
It fails because of these U1073 errors about msvcrt_winxp.obj. I checked and there is no msvcrt_winxp.obj file anywhere in C:\WinDDK or its subdirectories.
It looks to me the problem is not in the actual code, but maybe I haven't set up the DDK right before compiling. Why do I get these U1073 errors?
I found this similar question - driver build is failing for amd64 via winddk, but there the OP did has not included relevant information such as his build output, and his question is unanswered. I also found this thread - http://www.techtalkz.com/microsoft-device-drivers/295015-wdk-linker-error-u1073.html, but there is no answer there, as well.
My Build Output:
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\7600.16385.0\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Thu Nov 13 12:04:25 2014
BUILD: Examining c:\src directory tree for files to compile.
c:\src
c:\src\common
c:\src\driver
c:\src\ui
BUILD: Saving c:\winddk\7600.16385.0\build.dat...
1>BUILD: Compiling (NoSync) c:\src\driver directory
2>BUILD: Compiling (NoSync) c:\src\ui directory
_NT_TARGET_VERSION SET TO WINXP
_NT_TARGET_VERSION SET TO WINXP
1>BUILD: Linking for c:\src\driver directory
2>BUILD: Linking for c:\src\ui directory
_NT_TARGET_VERSION SET TO WINXP
_NT_TARGET_VERSION SET TO WINXP
1>errors in directory c:\src\driver
1>NMAKE : fatal error U1073: don't know how to make 'c:\winddk\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj'
2>errors in directory c:\src\ui
2>NMAKE : fatal error U1073: don't know how to make 'c:\winddk\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj'
1>nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2
2>nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2
BUILD: Finish time: Thu Nov 13 12:04:26 2014
BUILD: Done
0 files compiled - 4 Errors
I don't know why, but after I installed an even newer version - 7600.16385.1 from http://www.microsoft.com/en-us/download/details.aspx?id=11800, building worked fine, without any errors.
It didn't work the first time, however, but I noticed it was still complaining about 7600.16385.0, so I removed any intermediary build output, .err and .log files. After compiling again, it worked this time.
I also noticed that msvcrt_winxp.obj was present in c:\WinDDK\7600.16385.1, but not in c:\WinDDK\7600.16385.0.
I must admit that I hadn't downloaded c:\WinDDK\7600.16385.0, it was an old folder I found on my hard-drive, and I assumed I had used it to compile the project before, so I just copied it. The problems might have been because of this.
So in conclusion, the problem was with my WinDDK install, not with the project itself, and installing a newer version fixed it. Maybe re-installing the same version would have worked, too, but I have no need to verify that now that's working with the newer version.
Its kinda an odd story. I'm trying to build the openssl library. Well, it is not the first time I'm doing it and until now it was fine. however, I've desided to add a build configuration to TeamCity (actually the problem has nothing to do with TeamCity)to build all my third parties libraries on-demand. So, I created a step with common set of openssl build commands:
perl Configure VC-WIN64A
ms\do_win64a.bat
nmake /d /f ms\ntdll.mak
... and the build failed while assembling the very first asm file. So I ran same commands in VS2012 x64 command prompt and the build succedeed, as expected. It took a while untill I figured out that the problem is in output redirection. Teamcity redirects output from build step to the teamcity build log, so did I by adding ">1.txt" to "nmake /d /f ms\ntdll.mak" command, and the build failed. I would say it is somewhat unexpected reason for build to fail.
So far, I've tried:
Building the same from VS2010 command prompt with redirection,
failed.
Building the same from VS2010 command prompt without
redirection, succeded.
Building the same from VS2010/VS2012 command
prompt with redirection to file and forcing redirection to CON (nmake
/d /f ms\ntdll.mak >CON >1.txt) failed.
Googling for "nmake problems
when console output is redirected" - nothing
Googling for "openssl
build problems when console output is redirected" - nothing
My setup
- Win2008R2, virtual machine.
- VS2010, latest updates
- VS2012, Update 1
Actual error:
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\ml64.EXE"' : return code '0x1'
ml64.exe complains about the asm file stating it should end with "END" statement. It does, but...
Any ideas?
Ok, since the problem is in perl and writing files to stdout and then redirecting it you have to change following files to build x64 version:
crypto\aes\asm\aes-x86_64.pl
crypto\bn\asm\modexp512-x86_64.pl
crypto\bn\asm\x86_64-gf2m.pl
crypto\bn\asm\x86_64-mont.pl
crypto\bn\asm\x86_64-mont5.pl
crypto\md5\asm\md5-x86_64.pl
crypto\modes\asm\ghash-x86_64.pl
crypto\rc4\asm\rc4-md5-x86_64.pl
crypto\rc4\asm\rc4-x86_64.pl
crypto\sha\asm\sha1-x86_64.pl
crypto\sha\asm\sha512-x86_64.pl
crypto\whrlpool\asm\wp-x86_64.pl
crypto\x86_64cpuid.pl
engines\asm\e_padlock-x86_64.pl
you have to open these files and change all "open STDOUT "whateverfile"" to something like "open my $asmfile "whaeverfile"", then take care of string concatenation (only in x86_64cpuid.pl) and then print it to the file instead of STDOUT, something like "print $code" to "print $asm $code"
and of course, dont forget to close the file, in another words change the "close STDOUT" to "close $asmfile"
Obviously when building target other than x64 one will have to change another set of files.
Will try to communicate it to openssl maintainer.
Edit 2 -
I don't have the application file qmake in the /bin folder and this is the error I am getting.
Path environment variable : C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
Command Prompt - visual studio 2005
Source folder - C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4
Steps -
Downloaded src
Extracted the files to folder – qt-everywhere-opensource-src-4.7.4(C:\development\referencebuilds\qt\4.7.4)
configure.exe -opensource -fast -no-accessibility -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-webkit -no-scripttools -platform win32-msvc2005 -D “_BIND_TO_CURRENT_VCLIBS_VERSION=1”
4.nmake
The error I get is
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7
.4\bin\qmake C:/development/referencebuilds/qt/4.7.4/qt-everywhere-opensource-sr
c-4.7.4/\projects.pro -o Makefile -spec win32-msvc2005
'C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
qmake' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\development\referencebuilds\qt\4.7.4\qt-everywher
e-opensource-src-4.7.4\bin\qmake' : return code '0x1'
Stop.
I know I dont have the app files for qmake and many other appfiles in my \bin folder. How do I get them?
Edit 1
Well, after trying out all the answers, the situation still remains the same. I think i should add more details to what I am doing.
I am copying bin files(.dll , Appplication, Application Extension, Incremental Linker File, Program Debug Database, ) from another machine and the version of Qt was 4.7.2
My questions are -
1. Do you see that as the cause for all the issues here? If yes, how do I get all the above files? If I just congigure as above and then run nmake I get
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
C:\development\referencebuilds\qt\4.7.4\bin\qmake
C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile
-spec win32-msvc2008
'C:\development\referencebuilds\qt\4.7.4\bin\qmake' is not recognized
as an inte rnal or external command, operable program or batch file.
NMAKE : fatal error U1077:
'C:\development\referencebuilds\qt\4.7.4\bin\qmake' : return code
'0x1' Stop.
1, Downloaded the source file named
qt-everywhere-opensource-4.7.4 and saved it in folder c:\development\referencebuilds\qt\4.7.4\
2, uncompressed the zip file and the files extracted into folder
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
3, Copied back all files from the folder
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4 to c:\development\referencebuilds\qt\4.7.4\
4, ran
configure.exe -opensource -fast -no-acce ssibility -no-qt3support
-no-multimedia -no-audio-backend -no-phonon -no-phonon- backend
-no-webkit -no-scripttools -platform win32-msvc2008 -D
"_BIND_TO_CURRENT
_VCLIBS_VERSION=1"
5, nmake and now I get the following errors.
C:\development\referencebuilds\qt\4.7.4\bin\qmake
C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile
-spec win32-msvc2008 Could not find mkspecs for your
QMAKESPEC(win32-msvc2008) after trying:
C:\Qt\4.7.2\mkspecs Error processing project file:
C:/development/referencebuilds/qt/4.7.4//projects .pro NMAKE : fatal
error U1077: 'C:\development\referencebuilds\qt\4.7.4\bin\qmake.EX E'
: return code '0x3' Stop.
I have no clue as to why it is refering to C:\Qt\4.7.2\mkspecs . How do I get over this error? what is exactly happening. How do I prevent such issues in future?
Your install directory is:
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
Let's call it $(QTDIR). Now:
Extend your PATH variable to include $(QTDIR)\bin
Specify the QMAKESPEC environment variable to be win32-msvc2005
Open a Visual Studio command prompt to get the Visual Studio environment variables
Run configure
Run nmake
This procedure usually gets the Qt build to work for me.
Make sure that you don't have any existing QT directories in your path before you call configure and nmake.
It looks like you have a previous version of Qt installed. "C:\Qt\4.7.2\". And it would seem you have it setup in your system variables. Look for a variable called QTDIR in your system environment variables. Which is why you are getting an error, basically your 4.7.2 Qt is trying to build the new version.
Two options:
Un-install your old Qt via add/remove software in the control panel.
or
Remove your QTDIR system variable for the time being (will require a re-login) so that when you try to build from source it will use the correct binaries from the source folder.
Then just follow this guide:
http://en.wikibooks.org/wiki/Opticks_Developer_Guide/Getting_Started/Building_Qt_From_Source