开发者

Using libssl with nmake

    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 开发者_JAVA技巧$(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

I am getting following errors

    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

what is the problem in make file . how to link libssl with my app ?

you can download code from here https://rapidshare.com/files/458792519/test.rar (it includes code from liboauth )


To summarize the conversation in the comments on the OP, I downloaded the example code and ran nmake against it (makefile.nt). I did get linker errors but the missing symbols were from Win32 libs. I added user32.lib and gdi32.lib to the LIBS list in the makefile and it then linked cleanly (the build worked with VS2005, VS2008, and VS2010).

As the OP points out, it also linked cleanly when adding those two additional libraries. It is not clear to me how that would help resolve those symbols from libeay32.lib. So my suspicion is that the change to the make file resulted in a full rebuild and compile of all .obj files. The full clean build resulted in it working. So maybe (I'm just guessing) the .obj files were compiled incorrectly originally (compiler that didn't work well with the linker perhaps?) and the full rebuild made everything consistent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜