我在 Visual Studio 2008 中遇到了 tessdll 的几个问题。仅供参考,我将此应用程序创建为 MFC 应用程序,我这样做只是为了利用我需要的简单 GUI。从那里开始就是直接的 C++ 和 win32。
由于某种原因,这作为调试版本构建得很好(因为我已经包含了我需要的头文件和 lib 文件,并且 dll 驻留在我可以放置的每个目录中......)。
因此,在构建发布版本期间存在链接问题:
Linking...
MTGOBot.obj : error LNK2001: unresolved external symbol "__declspec
(dllimport) public: __thiscall TessDllAPI::TessDllAPI(char const
*)" (__imp_??0TessDllAPI@@QAE@PBD@Z)
MTGOBot.obj : error LNK2001: unresolved external symbol "__declspec
(dllimport) public: __thiscall TessDllAPI::~TessDllAPI(void)" (__imp_??
1TessDllAPI@@QAE@XZ)
MTGOBot.obj : error LNK2001: unresolved external symbol "__declspec
(dllimport) public: int __thiscall TessDllAPI::BeginPage(unsigned
int,unsigned int,unsigned char *,unsigned char)" (__imp_?
BeginPage@TessDllAPI@@QAEHIIPAEE@Z)
MTGOBot.obj : error LNK2001: unresolved external symbol "__declspec
(dllimport) public: struct ETEXT_STRUCT * __thiscall
TessDllAPI::Recognize_all_Words(void)" (__imp_?
Recognize_all_Words@TessDllAPI@@QAEPAUETEXT_STRUCT@@XZ)
C:\CPP Projects\Visual Studio 2008\Projects\MTGO SO Bot\MTGO SO Bot
\Release\MTGO SO Bot.exe : fatal error LNK1120: 4 unresolved externals
此外,作为参考,可以在此处找到 tessdll.h 的源代码: http ://code.google.com/p/tesseract-ocr/source/browse/trunk/tessdll.h?r=165
更多细节:
- 我从工具栏调试并使用集成调试器。
- 我使用 Batch Build 创建发布版本。