Chenhx / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

error LNK2001: unresolved external symbol "public: static char * __cdecl TessBaseAPI::TesseractRect(unsigned char const *,int,int,int,int,int,int)" (?TesseractRect@TessBaseAPI@@SAPADPBEHHHHHH@Z) #297

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using 2.04, VC++ 6
2. Add tessdll.lib in link, add #include "baseapi.h"

TessBaseAPI* api = new TessBaseAPI();
api->TesseractRect((BYTE*)ptImageBuffer,tiffFormat->GetBpp()/8, 
bytes_per_line,0,0,tiffFormat->GetWidth(),tiffFormat->GetHeight());

or 

TessBaseAPI::TesseractRect((BYTE*)ptImageBuffer,tiffFormat->GetBpp()/8, 
bytes_per_line,0,0,tiffFormat->GetWidth(),tiffFormat->GetHeight());

Both yield that linker error 1120

How do I link to this dll in VC6.0?

Original issue reported on code.google.com by albertos.email@gmail.com on 17 May 2010 at 10:22

GoogleCodeExporter commented 9 years ago
Add a #define TESSDLL_IMPORTS before you include baseapi.h.

Original comment by theraysm...@gmail.com on 20 May 2010 at 1:23

GoogleCodeExporter commented 9 years ago
get similar issue in xcode.
added statically compiled library to project(using 
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios
-armv6armv7i386/#comment-10) , #define TESSDLL_IMPORTS and #import "baseapi.h"

Undefined symbols for architecture armv7:
  "TessBaseAPI::ClearAdaptiveClassifier()", referenced from:
      -[OCRView freeMemory] in OCRView.o
      -[OCRView ocrImage:] in OCRView.o
  "TessBaseAPI::SimpleInit(char const*, char const*, bool)", referenced from:
      -[OCRView startTesseract] in OCRView.o
  "TessBaseAPI::End()", referenced from:
      -[OCRView dealloc] in OCRView.o
  "TessBaseAPI::SetVariable(char const*, char const*)", referenced from:
      -[OCRView startTesseract] in OCRView.o
  "TessBaseAPI::TesseractRect(unsigned char const*, int, int, int, int, int, int)", referenced from:
      -[OCRView ocrImage:] in OCRView.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

only have problem with tesseract 3+. works fine with 2.04.

how do i link in xcode? (let me know if this belongs elsewhere

Original comment by benjamin...@gmail.com on 12 Mar 2011 at 3:31

GoogleCodeExporter commented 9 years ago
Reference to this issue was posted in FAQ

Original comment by zde...@gmail.com on 2 Jan 2013 at 12:44