本文介绍了要使用静态库构建程序,libcurl.lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 static liblibcurl.lib 构建独立程序.但是我遇到了很多错误.

I tried to build a stanalone program with a static lib, libcurl.lib. But I got bunch of errors.

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

I ever refered to the related posts on stackoverflow and libcurl homepage, unfortunately it is in vain so far.

以下是我的构建过程和我得到的错误信息.

The following is my building procedure and the error message I got.

请评论.非常感谢,

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

推荐答案

我终于弄明白了.我必须使用:

I figure it out finally.I have to use:

  • "nmake RTLIBCFG=static/f Makefile.vc mode=static VC=14ENABLE_IPV6=no ENABLE_IDN=no GEN_PDB=no DEBUG=no MACHINE=x64"第一步

  • "nmake RTLIBCFG=static /f Makefile.vc mode=static VC=14ENABLE_IPV6=no ENABLE_IDN=no GEN_PDB=no DEBUG=no MACHINE=x64" in thefirst step

像 Hans 一样使用cl.exe"对每个步骤使用/MT 选项进行编译帕桑特评论.

compile with /MT option for every steps using "cl.exe" like HansPassant commented.

希望这可以帮助遇到相同问题的人.顺便说一句,我找到了一个具有类似解决方案的网站,如下所示,http://www.chipkin.com/building-libcurl-on-windows-with-mt-and-mtd/.

Hopefully, this can help out people suffering in the same issue.Bby the way, I found a the website with similar solution as below, http://www.chipkin.com/building-libcurl-on-windows-with-mt-and-mtd/.

这篇关于要使用静态库构建程序,libcurl.lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 17:37