首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用libssl与nmake

使用libssl与nmake
EN

Stack Overflow用户
提问于 2011-04-21 12:02:52
回答 1查看 2.7K关注 0票数 1
代码语言:javascript
复制
    LIBS =   ws2_32.lib winmm.lib advapi32.lib  crypt32.lib user32.lib gdi32.lib   libeay32.lib ssleay32.lib 

OSCOMPAT = /DWIN32 /D_WIN32_WINNT=0x0400
VSCOMPAT = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE  
CFLAGS= -I . -I$C /MT /W3 $(OSCOMPAT) $(VSCOMPAT) -nologo $(EXTRACFLAGS)

test: $(CCLIENTLIB) test.obj oauth.obj hash.obj oauth_http.obj xmalloc.obj 
    LINK /NOLOGO mtest.obj oauth.obj hash.obj oauth_http.obj xmalloc.obj  $(LIBS) 


test.obj:test.c 
oauth.obj: oauth.c
hash.obj: hash.c
oauth_http.obj: oauth.h oauth_http.c
xmalloc.obj: xmalloc.c

我收到了以下错误

代码语言:javascript
复制
    LINK /NOLOGO test.obj oauth.obj hash.obj oauth_http.obj xmalloc.obj    ws2_32.lib winmm.lib advapi32.lib  crypt32.lib user32.lib gdi32.lib   libeay32.lib ssleay32.lib
hash.obj : error LNK2019: unresolved external symbol HMAC referenced in function oauth_sign_hmac_sha1_raw
hash.obj : error LNK2019: unresolved external symbol EVP_sha1 referenced in function oauth_sign_hmac_sha1_raw
hash.obj : error LNK2019: unresolved external symbol EVP_PKEY_free referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol CRYPTO_free referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_SignFinal referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_DigestUpdate referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_DigestInit referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_PKEY_size referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol BIO_free referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol PEM_read_bio_PrivateKey referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol BIO_new_mem_buf referenced in function oauth_sign_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_MD_CTX_cleanup referenced in function oauth_verify_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_VerifyFinal referenced in function oauth_verify_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol PEM_read_bio_PUBKEY referenced in function oauth_verify_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol X509_free referenced in function oauth_verify_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol X509_get_pubkey referenced in function oauth_verify_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol PEM_read_bio_X509 referenced in function oauth_verify_rsa_sha1
hash.obj : error LNK2019: unresolved external symbol EVP_DigestFinal referenced in function oauth_body_hash_file
hash.obj : error LNK2019: unresolved external symbol EVP_MD_size referenced in function oauth_body_hash_file
hash.obj : error LNK2019: unresolved external symbol EVP_MD_CTX_init referenced in function oauth_body_hash_file
test.exe : fatal error LNK1120: 20 unresolved externals

制作文件中的问题是什么?如何将libssl链接到我的应用程序?

您可以从这里下载代码https://rapidshare.com/files/458792519/test.rar (包括liboauth的代码)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-04-28 13:13:00

为了总结OP注释中的对话,我下载了示例代码并针对它运行了nmake (makefile.nt)。我确实得到了链接器错误,但是缺少的符号来自Win32库。我将user32.lib和gdi32.lib添加到makefile中的LIBS列表中,然后它干净地链接(构建使用了VS2005、VS2008和VS2010)。

正如OP所指出的,在添加这两个额外的库时,它也会干净地链接。我不清楚这将如何帮助解析libeay32.lib中的这些符号。因此,我怀疑,对make文件的更改导致了对所有.obj文件的完全重建和编译。完全干净的构建导致了它的工作。因此,也许(我只是猜测) .obj文件最初编译得不正确(编译器可能对链接器没有很好的工作?)整个重建使一切都保持一致。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5743808

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档