使用静态库libcurl.lib构建程序

时间:2015-11-16 11:43:56

标签: windows visual-c++ static-libraries cl.exe

我尝试使用static liblibcurl.lib构建一个stanalone程序。但是我收到了很多错误。

我曾经参考过stackoverflow和libcurl主页上的相关帖子,不幸的是到目前为止它是徒劳的。

以下是我的构建过程和我收到的错误消息。

请评论。 非常感谢你,

1. Build curl from source code
    nmake /f Makefile.vc mode=static VC=14  ENABLE_SSPI=no ENABLE_IPV6=no ENABLE_IDN=no GEN_PDB=no DEBUG=no MACHINE=x64

2. Build main.obj CimXml.obj CimCurl.obj getpass.obj
    "cl -I.\include -DCURL_STATICLIB -EHsc -c main.cpp CimXml.cpp CimCurl.cpp getpass.cpp"

3. Build a "STATIC" library cimxml.lib  
    "lib CimXml.obj CimCurl.obj getpass.obj /out:cimxmlcurl.lib"

4. Build the alc.exe
    "cl -DCURL_STATICLIB -I.\include main.obj cimxmlcurl.lib libcurl_a.lib /link /LIBPATH:.\lib /verbose:lib /out:alc.exe"

错误讯息:

C:\Users\nick\Documents\sblim-wbemcli-1.6.3-Beta>cl -DCURL_STATICLIB -I.\include main.obj cimxmlcurl .lib libcurl_a.lib /link /LIBPATH:.\lib /verbose:lib /out:alc.exe

Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:main.exe
/LIBPATH:.\lib
/nodefaultlib:MSVCRT.lib
/verbose:lib
/out:alc.exe
main.obj
cimxmlcurl.lib
libcurl_a.lib

Searching libraries
    Searching cimxmlcurl.lib:
    Searching .\lib\libcurl_a.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\libcpmt.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\uuid.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\LIBCMT.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\kernel32.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\advapi32.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\libvcruntime.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64\libucrt.lib:
    Searching cimxmlcurl.lib:
    Searching .\lib\libcurl_a.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\libcpmt.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\uuid.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\LIBCMT.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\kernel32.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\advapi32.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\libvcruntime.lib:

Finished searching libraries

Searching libraries
    Searching cimxmlcurl.lib:
    Searching .\lib\libcurl_a.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\libcpmt.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\uuid.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\LIBCMT.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\OLDNAMES.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\kernel32.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64\advapi32.lib:
    Searching C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64\libvcruntime.lib:
    Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64\libucrt.lib:

Finished searching libraries
    libcurl_a.lib(easy.obj) : warning LNK4217: locally defined symbol strdup imported in function curl_easy_init
    OLDNAMES.lib(strdup.obi) : warning LNK4049: locally defined symbol strdup imported
    libcurl_a.lib(easy.obj) : warning LNK4217: locally defined symbol calloc imported in function curl_easy_init
    libcurl_a.lib(easy.obj) : warning LNK4217: locally defined symbol free imported in function curl_easy_init
    libcurl_a.lib(easy.obj) : warning LNK4217: locally defined symbol malloc imported in function curl_easy_init
    libcurl_a.lib(easy.obj) : warning LNK4217: locally defined symbol realloc imported in function curl_easy_init
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strrchr imported
    libcurl_a.lib(formdata.obj) : warning LNK4049: locally defined symbol strrchr imported
    libcurl_a.lib(strerror.obj) : warning LNK4217: locally defined symbol strrchr imported in function Curl_strerror
    libcurl_a.lib(cookie.obj) : warning LNK4049: locally defined symbol strrchr imported
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol strrchr imported
    libcurl_a.lib(transfer.obj) : warning LNK4049: locally defined symbol strrchr imported
    libcurl_a.lib(strerror.obj) : warning LNK4217: locally defined symbol strerror imported in function Curl_strerror
    libcurl_a.lib(strerror.obj) : warning LNK4217: locally defined symbol strncpy imported in function Curl_strerror
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol strncpy imported
    libcurl_a.lib(telnet.obj) : warning LNK4049: locally defined symbol strncpy imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strncpy imported
    libcurl_a.lib(strerror.obj) : warning LNK4217: locally defined symbol __sys_nerr imported in function Curl_strerror
    libcurl_a.lib(pingpong.obj) : warning LNK4049: locally defined symbol memmove imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol memmove imported in function sanitize_cookie_path
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol memmove imported
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol memmove imported
    libcurl_a.lib(imap.obj) : warning LNK4049: locally defined symbol memmove imported
    libcurl_a.lib(ftplistparser.obj) : warning LNK4217: locally defined symbol strchr imported in function Curl_ftp_parselist
    libcurl_a.lib(curl_ntlm_msgs.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(http_digest.obj) : warning LNK4217: locally defined symbol strchr imported in function Curl_output_digest
    libcurl_a.lib(dotdot.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(formdata.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(curl_gethostname.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(ldap.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(file.obj) : warning LNK4217: locally defined symbol strchr imported in function file_do
    libcurl_a.lib(smb.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(pipeline.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(strtok.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(inet_pton.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(dict.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol strchr imported in function Curl_cookie_add
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol strchr imported
    libcurl_a.lib(transfer.obj) : warning LNK4217: locally defined symbol strchr imported in function _vsscanf_l
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol strncmp imported
    libcurl_a.lib(rtsp.obj) : warning LNK4217: locally defined symbol strncmp imported in function rtsp_do
    libcurl_a.lib(dotdot.obj) : warning LNK4217: locally defined symbol strncmp imported in function Curl_dedotdotify
    libcurl_a.lib(ftplistparser.obj) : warning LNK4217: locally defined symbol strncmp imported in function Curl_ftp_parselist
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol strncmp imported in function Curl_cookie_add
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol strncmp imported
    libcurl_a.lib(connect.obj) : warning LNK4217: locally defined symbol strncmp imported in function Curl_sndbufset
    libcurl_a.lib(mprintf.obj) : warning LNK4217: locally defined symbol strncmp imported in function curl_mprintf
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function Curl_cookie_init
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
    libcurl_a.lib(mprintf.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function _vsnprintf_l
    libcurl_a.lib(formdata.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol fclose imported in function Curl_cookie_init
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol fclose imported
    libcurl_a.lib(netrc.obj) : warning LNK4049: locally defined symbol fclose imported
    libcurl_a.lib(formdata.obj) : warning LNK4049: locally defined symbol fclose imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol fgets imported in function Curl_cookie_init
    libcurl_a.lib(netrc.obj) : warning LNK4049: locally defined symbol fgets imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol fopen imported in function Curl_cookie_init
    libcurl_a.lib(netrc.obj) : warning LNK4049: locally defined symbol fopen imported
    libcurl_a.lib(formdata.obj) : warning LNK4049: locally defined symbol fopen imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(rtsp.obj) : warning LNK4217: locally defined symbol __stdio_common_vsscanf imported in function rtsp_do
    libcurl_a.lib(socks.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(http_proxy.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(transfer.obj) : warning LNK4217: locally defined symbol __stdio_common_vsscanf imported in function readwrite_data
    libcurl_a.lib(parsedate.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(telnet.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(imap.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol __stdio_common_vsscanf imported in function _vsscanf_l
    libcurl_a.lib(hostip.obj) : warning LNK4217: locally defined symbol __stdio_common_vsscanf imported in function Curl_global_host_cache_init
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol __stdio_common_vsscanf imported
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol qsort imported in function Curl_cookie_getlist
    libcurl_a.lib(file.obj) : warning LNK4049: locally defined symbol strtoll imported
    libcurl_a.lib(http_proxy.obj) : warning LNK4049: locally defined symbol strtoll imported
    libcurl_a.lib(http_chunks.obj) : warning LNK4217: locally defined symbol strtoll imported in function Curl_chunked_strerror
    libcurl_a.lib(ftplistparser.obj) : warning LNK4217: locally defined symbol strtoll imported in function Curl_ftp_parselist
    libcurl_a.lib(cookie.obj) : warning LNK4217: locally defined symbol strtoll imported in function Curl_cookie_add
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol strtoll imported
    libcurl_a.lib(imap.obj) : warning LNK4049: locally defined symbol strtoll imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strtoll imported
    libcurl_a.lib(asyn-thread.obj) : warning LNK4217: locally defined symbol _errno imported in function init_resolve_thread
    libcurl_a.lib(http_chunks.obj) : warning LNK4049: locally defined symbol _errno imported
    libcurl_a.lib(ftplistparser.obj) : warning LNK4217: locally defined symbol _errno imported in function Curl_ftp_parselist
    libcurl_a.lib(hostip.obj) : warning LNK4217: locally defined symbol tolower imported in function Curl_cache_addr
    libcurl_a.lib(url.obj) : warning LNK4049: locally defined symbol tolower imported
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol isalpha imported in function parse_proxy
    libcurl_a.lib(parsedate.obj) : warning LNK4049: locally defined symbol isalpha imported
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4049: locally defined symbol isalpha imported
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol isxdigit imported in function parse_proxy
    libcurl_a.lib(escape.obj) : warning LNK4049: locally defined symbol isxdigit imported
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4049: locally defined symbol isxdigit imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strstr imported
    libcurl_a.lib(curl_sasl.obj) : warning LNK4217: locally defined symbol strstr imported in function Curl_sasl_continue
    libcurl_a.lib(ftplistparser.obj) : warning LNK4049: locally defined symbol strstr imported
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol strstr imported in function parse_proxy
    libcurl_a.lib(http.obj) : warning LNK4217: locally defined symbol strstr imported in function Curl_http_readwrite_headers
    libcurl_a.lib(transfer.obj) : warning LNK4049: locally defined symbol strstr imported
    libcurl_a.lib(tftp.obj) : warning LNK4049: locally defined symbol strstr imported
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol strpbrk imported in function parseurlandfillconn
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol fwrite imported in function Curl_init_userdefined
    libcurl_a.lib(sendf.obj) : warning LNK4049: locally defined symbol fwrite imported
    libcurl_a.lib(tftp.obj) : warning LNK4049: locally defined symbol strtol imported
    libcurl_a.lib(smtp.obj) : warning LNK4049: locally defined symbol strtol imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strtol imported
    libcurl_a.lib(ftplistparser.obj) : warning LNK4049: locally defined symbol strtol imported
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol strtol imported in function parse_proxy
    libcurl_a.lib(mprintf.obj) : warning LNK4049: locally defined symbol strtol imported
    libcurl_a.lib(pipeline.obj) : warning LNK4217: locally defined symbol strtol imported in function Curl_pipeline_penalized
    libcurl_a.lib(parsedate.obj) : warning LNK4049: locally defined symbol strtol imported
    libcurl_a.lib(url.obj) : warning LNK4217: locally defined symbol strtoul imported in function parseurlandfillconn
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol strtoul imported
    libcurl_a.lib(escape.obj) : warning LNK4049: locally defined symbol strtoul imported
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(smtp.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(curl_sasl.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(ftplistparser.obj) : warning LNK4217: locally defined symbol isdigit imported in function Curl_ftp_parselist
    libcurl_a.lib(mprintf.obj) : warning LNK4217: locally defined symbol isdigit imported in function dprintf_DollarString
    libcurl_a.lib(http.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(parsedate.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(imap.obj) : warning LNK4049: locally defined symbol isdigit imported
    libcurl_a.lib(mprintf.obj) : warning LNK4217: locally defined symbol fputc imported in function curl_mfprintf
    libcurl_a.lib(mprintf.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function _vsnprintf_l
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(http_digest.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(curl_ntlm.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(curl_sasl.obj) : warning LNK4217: locally defined symbol isspace imported in function Curl_sasl_continue
    libcurl_a.lib(ftplistparser.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(http.obj) : warning LNK4217: locally defined symbol isspace imported in function Curl_add_custom_headers
    libcurl_a.lib(ftp.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(file.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(rtsp.obj) : warning LNK4049: locally defined symbol isspace imported
    libcurl_a.lib(http.obj) : warning LNK4217: locally defined symbol memchr imported in function Curl_http_readwrite_headers
    libcurl_a.lib(tftp.obj) : warning LNK4217: locally defined symbol memchr imported in function tftp_connect
    libcurl_a.lib(transfer.obj) : warning LNK4217: locally defined symbol fseek imported in function Curl_readrewind
    libcurl_a.lib(progress.obj) : warning LNK4217: locally defined symbol fflush imported in function Curl_pgrsUpdate
    libcurl_a.lib(strequal.obj) : warning LNK4217: locally defined symbol stricmp imported in function curl_strequal
    OLDNAMES.lib(stricmp.obi) : warning LNK4049: locally defined symbol stricmp imported
    libcurl_a.lib(strequal.obj) : warning LNK4217: locally defined symbol strnicmp imported in function curl_strnequal
    OLDNAMES.lib(strnicmp.obi) : warning LNK4049: locally defined symbol strnicmp imported
    libcurl_a.lib(parsedate.obj) : warning LNK4217: locally defined symbol isalnum imported in function parsedate
    libcurl_a.lib(rtsp.obj) : warning LNK4049: locally defined symbol isalnum imported
    libcurl_a.lib(ftplistparser.obj) : warning LNK4049: locally defined symbol isalnum imported
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4049: locally defined symbol isalnum imported
    libcurl_a.lib(telnet.obj) : warning LNK4217: locally defined symbol atoi imported in function check_telnet_options
    libcurl_a.lib(file.obj) : warning LNK4217: locally defined symbol _lseeki64 imported in function file_do
    libcurl_a.lib(getenv.obj) : warning LNK4217: locally defined symbol getenv imported in function GetEnv
    libcurl_a.lib(curl_sasl.obj) : warning LNK4217: locally defined symbol isupper imported in function Curl_sasl_decode_mech
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4049: locally defined symbol isupper imported
    libcurl_a.lib(curl_ntlm_core.obj) : warning LNK4217: locally defined symbol toupper imported in function Curl_ntlm_core_mk_ntlmv2_hash
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4217: locally defined symbol islower imported in function loop
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4217: locally defined symbol isprint imported in function loop
    libcurl_a.lib(curl_fnmatch.obj) : warning LNK4217: locally defined symbol isgraph imported in function loop
    OLDNAMES.lib(strdup.obi) : warning LNK4049: locally defined symbol _strdup imported
    OLDNAMES.lib(read.obi) : warning LNK4049: locally defined symbol _read imported
    OLDNAMES.lib(write.obi) : warning LNK4049: locally defined symbol _write imported
    OLDNAMES.lib(stricmp.obi) : warning LNK4049: locally defined symbol _stricmp imported
    OLDNAMES.lib(strnicmp.obi) : warning LNK4049: locally defined symbol _strnicmp imported
    OLDNAMES.lib(close.obi) : warning LNK4049: locally defined symbol _close imported
    OLDNAMES.lib(open.obi) : warning LNK4049: locally defined symbol _open imported
    libcurl_a.lib(cookie.obj) : error LNK2019: unresolved external symbol __imp_fputs referenced in function cookie_output
    libcurl_a.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp__time64
    libcurl_a.lib(curl_ntlm_core.obj) : error LNK2001: unresolved external symbol __imp__time64
    libcurl_a.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp__time64
    libcurl_a.lib(hostip.obj) : error LNK2001: unresolved external symbol __imp__time64
    libcurl_a.lib(http.obj) : error LNK2001: unresolved external symbol __imp__time64
    libcurl_a.lib(tftp.obj) : error LNK2001: unresolved external symbol __imp__time64
    libcurl_a.lib(url.obj) : error LNK2019: unresolved external symbol __imp_fread referenced in function Curl_init_userdefined
    libcurl_a.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp_fread
    libcurl_a.lib(formdata.obj) : error LNK2001: unresolved external symbol __imp_fread
    libcurl_a.lib(warnless.obj) : error LNK2019: unresolved external symbol __imp_read referenced in function curlx_read
    OLDNAMES.lib(read.obi) : error LNK2001: unresolved external symbol __imp_read
    libcurl_a.lib(warnless.obj) : error LNK2019: unresolved external symbol __imp_write referenced in function curlx_write
    OLDNAMES.lib(write.obi) : error LNK2001: unresolved external symbol __imp_write
    libcurl_a.lib(parsedate.obj) : error LNK2019: unresolved external symbol __imp__gmtime64 referenced in function Curl_gmtime
    libcurl_a.lib(curl_threads.obj) : error LNK2019: unresolved external symbol __imp__beginthreadex referenced in function Curl_thread_create
    libcurl_a.lib(file.obj) : error LNK2019: unresolved external symbol __imp_close referenced in function file_done
    OLDNAMES.lib(close.obi) : error LNK2001: unresolved external symbol __imp_close
    libcurl_a.lib(file.obj) : error LNK2019: unresolved external symbol __imp_open referenced in function file_connect
    OLDNAMES.lib(open.obi) : error LNK2001: unresolved external symbol __imp_open
    libcurl_a.lib(file.obj) : error LNK2019: unresolved external symbol __imp__fstat64 referenced in function file_do
    libcurl_a.lib(smb.obj) : error LNK2019: unresolved external symbol __imp__getpid referenced in function smb_format_message
    libcurl_a.lib(formdata.obj) : error LNK2019: unresolved external symbol __imp__stat64 referenced infunction AddFormData
    alc.exe : fatal error LNK1120: 12 unresolved externals

1 个答案:

答案 0 :(得分:3)

我终于明白了。 我必须使用:

  • “nmake RTLIBCFG = static / f Makefile.vc mode = static VC = 14 ENABLE_IPV6 =没有ENABLE_IDN =没有GEN_PDB =没有DEBUG =没有MACHINE = x64“在 第一步

  • 使用像/ Hans这样的“cl.exe”为每个步骤编译/ MT选项 Passant评论说。

    希望这可以帮助那些在同一问题上受苦的人。 顺便说一句,我发现了一个网站,其解决方案如下,http://www.chipkin.com/building-libcurl-on-windows-with-mt-and-mtd/