how to resolve linking error?

437 views
Skip to first unread message

st87

unread,
Jan 20, 2012, 5:55:10 AM1/20/12
to tesseract-ocr
Hi,
I've already complie the project in Release mode and I have link all
the library, put the Additional link and preprocessor inf. on my
Visual c++ 2005 project. My code doesn't work but i don't know why?
Someone can help me
I post the debug error:
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: __thiscall
STRING::~STRING(void)" (__imp_??1STRING@@QAE@XZ)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: int __thiscall
tesseract::TessBaseAPI::Init(char const *,char const *)" (__imp_?
Init@TessBaseAPI@tesseract@@QAEHPBD0@Z)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: __thiscall
tesseract::TessBaseAPI::TessBaseAPI(void)" (__imp_??
0TessBaseAPI@tesseract@@QAE@XZ)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: virtual __thiscall
tesseract::TessBaseAPI::~TessBaseAPI(void)" (__imp_??
1TessBaseAPI@tesseract@@UAE@XZ)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: void __thiscall
tesseract::TessBaseAPI::SetPageSegMode(enum
tesseract::PageSegMode)" (__imp_?
SetPageSegMode@TessBaseAPI@tesseract@@QAEXW4PageSegMode@2@@Z)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: void __thiscall
tesseract::TessBaseAPI::SetImage(struct Pix const *)" (__imp_?
SetImage@TessBaseAPI@tesseract@@QAEXPBUPix@@@Z)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: char * __thiscall
tesseract::TessBaseAPI::GetUTF8Text(void)" (__imp_?
GetUTF8Text@TessBaseAPI@tesseract@@QAEPADXZ)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: int __thiscall
tesseract::TessBaseAPI::MeanTextConf(void)" (__imp_?
MeanTextConf@TessBaseAPI@tesseract@@QAEHXZ)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: bool __thiscall
tesseract::TessBaseAPI::GetTextDirection(int *,float *)" (__imp_?
GetTextDirection@TessBaseAPI@tesseract@@QAE_NPAHPAM@Z)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: void __thiscall
tesseract::TessBaseAPI::Clear(void)" (__imp_?
Clear@TessBaseAPI@tesseract@@QAEXXZ)
1>OpticalCharRecognition.obj : error LNK2001: unresolved external
symbol "__declspec(dllimport) public: void __thiscall
tesseract::TessBaseAPI::End(void)" (__imp_?
End@TessBaseAPI@tesseract@@QAEXXZ)

and this is the source code:



#include <baseapi.h>
#include <resultiterator.h>

#include <allheaders.h>

using namespace tesseract;

tesseract::TessBaseAPI api;
PIX *pix;
pix = pixRead("C:\\immagini\\elaborating.jpg");

api.Init(NULL, "eng");
api.SetPageSegMode(tesseract::PSM_AUTO);
api.SetImage(pix);

char* outText = api.GetUTF8Text();
int conf = api.MeanTextConf();
int offset=0;
float slope=0;
api.GetTextDirection(&offset, &slope);
/*
std::cout<<"Confidence: "<< conf<< std::endl;
std::cout<<"PARAMETRI IMMAGINE: -offset: "<<offset << " -pendenza :"
<<slope<< std::endl;
std::cout<<"Risulatato: "<<outText<<std::endl;
*/
api.Clear();
api.End();
delete outText;
pixDestroy(&pix);
Reply all
Reply to author
Forward
0 new messages