Error when build C++ Visual Studio 2017 project after include tesseract 4.0 library

294 views
Skip to first unread message

Tiến Nguyễn

unread,
Aug 20, 2018, 4:18:53 AM8/20/18
to tesseract-ocr
I am using windows 10 and manually build my own tesseract 4.0 and leptonica-1.76.0 library. 

When I include file .h and library in configuring of the project. It shows error like below

error.png

1>------ Rebuild All started: Project: Test_Tesseractv4, Configuration: Debug x64 ------
1>Source.cpp
1>.NETFramework,Version=v4.6.1.AssemblyAttributes.cpp
1>MSVCRTD.lib(throw_bad_alloc.obj) : error LNK2005: "public: virtual char const * __cdecl std::exception::what(void)const " (?what@exception@std@@UEBAPEBDXZ) already defined in tesseract40.lib(tesseract40.dll)
1>Source.obj : warning LNK4248: unresolved typeref token (01000023) for 'GenericVector<STRING>'; image may not run
1>C:\Users\nvtie\source\repos\Test_Tesseractv4\x64\Debug\Test_Tesseractv4.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Done building project "Test_Tesseractv4.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Please help me out. 

If you guy has tesseract 4.0 library and includes folder. Please help me set up and run C++ project with tesseract 4.0 library.

wunyee

unread,
Nov 7, 2019, 1:45:41 PM11/7/19
to tesseract-ocr
Hi,
I have the same problem, have you found a solution?

Tiến Nguyễn於 2018年8月20日星期一 UTC+8下午4時18分53秒寫道:

Essam Zaky

unread,
Nov 20, 2019, 2:32:49 AM11/20/19
to tesseract-ocr
HI, try to use ignore error for multiple definition as follow
try to use /FORCE:MULTIPLE linker option in your project
here it the steps

To set this linker option in the Visual Studio development environment

  1. Right-click on the project in Solution Explorer and choose Properties.

  2. Click the Linker folder.

  3. Click the Command Line property page.

  4. Type the option /FORCE:MULTIPLE into the Additional Options box.

and build your project the error will be converted to warning 
Reply all
Reply to author
Forward
0 new messages