簡體   English   中英

在Windows上構建PoDoFo-尚未解決的外部問題

[英]Building PoDoFo on Windows - unresolved externals

我正在嘗試構建PoDoFo,但與OpenSSL相關的鏈接器錯誤很少(我認為)。 我嘗試構建它(OpenSSL),但是它太復雜了,因此我從http://slproweb.com/products/Win32OpenSSL.html下載了Win64 OpenSSL v1.0.1e。

我從以下代碼制作了Visual Studio解決方案:

del cmakecache.txt
set FTDIR=D:\Iwan\Projekty\PDF_projekt\freetype-2.4.11
set FTLIBDIR=D:\Iwan\Projekty\PDF_projekt\freetype-2.4.11\objs\win32\vc2010
set JPEGDIR=D:\Iwan\Projekty\PDF_projekt\jpeg-9
set ZLIBDIR=D:\Iwan\Projekty\PDF_projekt\zlib127-dll
set LIBCRYPTODIR=C:\OpenSSL-Win64
cmake -G "Visual Studio 10" ..\podofo-0.9.2 -DCMAKE_INCLUDE_PATH="%FTDIR%\include;%JPEGDIR%\include;%JPEGDIR%;%ZLIBDIR%\include;%LIBCRYPTODIR%\include;%LIBCRYPTODIR%\include\openssl" -DCMAKE_LIBRARY_PATH="%FTLIBDIR%;%FTDIR%\lib;%JPEGDIR%\lib;%JPEGDIR%;%ZLIBDIR%\lib;%LIBCRYPTODIR%\lib\VC" -DPODOFO_BUILD_SHARED:BOOL=TRUE -DFREETYPE_LIBRARY_NAMES_DEBUG=freetype2411MT_D -DFREETYPE_LIBRARY_NAMES_RELEASE=freetype2411MT -DLIBCRYPTO_LIBRARY_NAMES_DEBUG=libeay32MDd -DLIBCRYPTO_LIBRARY_NAMES_RELEASE=libeay32MD

我不確定應該在選項中添加哪個庫,但是嘗試了libeay32MD,sleay32MD,libeay32MT,ssleay32MT,libeay32和ssleay32。

當我嘗試編譯創建的解決方案時,出現以下鏈接器錯誤:

2>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
2>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_CIPHER_CTX_init referenced in function "public: __thiscall PoDoFo::AESCryptoEngine::AESCryptoEngine(void)" (??0AESCryptoEngine@PoDoFo@@QAE@XZ)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_CIPHER_CTX_cleanup referenced in function "public: __thiscall PoDoFo::AESCryptoEngine::~AESCryptoEngine(void)" (??1AESCryptoEngine@PoDoFo@@QAE@XZ)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_EncryptFinal_ex referenced in function "protected: void __thiscall PoDoFo::PdfEncryptRC4Base::RC4(unsigned char const *,int,unsigned char const *,int,unsigned char *,int)" (?RC4@PdfEncryptRC4Base@PoDoFo@@IAEXPBEH0HPAEH@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_EncryptUpdate referenced in function "protected: void __thiscall PoDoFo::PdfEncryptRC4Base::RC4(unsigned char const *,int,unsigned char const *,int,unsigned char *,int)" (?RC4@PdfEncryptRC4Base@PoDoFo@@IAEXPBEH0HPAEH@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_CIPHER_CTX_set_key_length referenced in function "protected: void __thiscall PoDoFo::PdfEncryptRC4Base::RC4(unsigned char const *,int,unsigned char const *,int,unsigned char *,int)" (?RC4@PdfEncryptRC4Base@PoDoFo@@IAEXPBEH0HPAEH@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_EncryptInit_ex referenced in function "protected: void __thiscall PoDoFo::PdfEncryptRC4Base::RC4(unsigned char const *,int,unsigned char const *,int,unsigned char *,int)" (?RC4@PdfEncryptRC4Base@PoDoFo@@IAEXPBEH0HPAEH@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_rc4 referenced in function "protected: void __thiscall PoDoFo::PdfEncryptRC4Base::RC4(unsigned char const *,int,unsigned char const *,int,unsigned char *,int)" (?RC4@PdfEncryptRC4Base@PoDoFo@@IAEXPBEH0HPAEH@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _MD5_Final referenced in function "public: static void __cdecl PoDoFo::PdfEncryptMD5Base::GetMD5Binary(unsigned char const *,int,unsigned char *)" (?GetMD5Binary@PdfEncryptMD5Base@PoDoFo@@SAXPBEHPAE@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _MD5_Update referenced in function "public: static void __cdecl PoDoFo::PdfEncryptMD5Base::GetMD5Binary(unsigned char const *,int,unsigned char *)" (?GetMD5Binary@PdfEncryptMD5Base@PoDoFo@@SAXPBEHPAE@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _MD5_Init referenced in function "public: static void __cdecl PoDoFo::PdfEncryptMD5Base::GetMD5Binary(unsigned char const *,int,unsigned char *)" (?GetMD5Binary@PdfEncryptMD5Base@PoDoFo@@SAXPBEHPAE@Z)
2>PdfEncrypt.obj : error LNK2019: unresolved external symbol _EVP_aes_128_cbc referenced in function "protected: void __thiscall PoDoFo::PdfEncryptAESBase::AES(unsigned char const *,int,unsigned char const *,unsigned char const *,int,unsigned char *,int)" (?AES@PdfEncryptAESBase@PoDoFo@@IAEXPBEH00HPAEH@Z)

我正在嘗試將其編譯2天,但是我什么都沒做,而且在互聯網上找不到任何東西。

您需要自己構建OpenSSL。 並沒有那么復雜-這是相關的命令列表,取自與源代碼捆綁在一起的install.w64文件:

 > perl Configure VC-WIN64A
 > ms\do_win64a
 > nmake -f ms\ntdll.mak
 > cd out32dll
 > ..\ms\test

此處未提及的內容應在Visual Studio的命令提示符(“工具”菜單)中運行。 Perl在此處不可見,因此您應該首先運行命令:

set path=%path;c:\perl\bin

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM