gpt4 book ai didi

c++ - 在 Windows 上构建 PoDoFo - Unresolved external 问题

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:57:46 25 4
gpt4 key购买 nike

我正在尝试构建 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 天,但我没有做任何工作,而且我在 Internet 上找不到任何东西。

最佳答案

您需要自己构建 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

关于c++ - 在 Windows 上构建 PoDoFo - Unresolved external 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15688577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com