New issue 614 by tomp2...@gmail.com: ccutil/strngs.h in r658 broke STRING
class DLL exporting on Windows builds
http://code.google.com/p/tesseract-ocr/issues/detail?id=614
When trying to build tesseract.exe 3.02 on Windows 7 SP1 using Visual
Studio 2008 SP1 and my DLL version of libtesseract, I get the following
message (along with lots of similar ones):
Error 2 error LNK2019: unresolved external symbol "public: __thiscall
STRING::~STRING(void)" (??1STRING@@QAE@XZ) referenced in function _main
tesseractmain.obj tesseract
Tracking this down I see that tesseractmain.cpp does things like:
STRING text_out;
So it needs access to the actual class (and won't be satisfied with "class
STRING;" in baseapi.h.
However, in r658 theraysmith changed ccutils/strngs.h from:
class CCUTIL_API STRING
to
class DLLSYM STRING
despite his saying at [1] that "DLLSYM is obsolete and just needs defining
to nothing or deleting from everywhere". :P
This disables the code that uses CCUTIL_EXPORTS & CCUTIL_IMPORTS to
correctly set CCUTIL_API to the appropriate __declspec declaration.
Reverting this change let's tesseract.exe link to my libtesseract302d.dll.
[1] http://groups.google.com/group/tesseract-dev/msg/5e0f7f7fab27b463
Better yet, get rid of CCUTIL_EXPORTS, CCUTIL_IMPORTS, CCUTIL_API (which
are *only* used in strngs.h) and use the analogous, already existing
TESSDLL_EXPORTS, TESSDLL_IMPORTS, TESSDLL_API defined in baseapi.h.
Of course, this means you probably should also include baseapi.h in
strngs.h just in case.
I put back "class CCUTIL_API STRING". I keep issue open for further
discussion(?)/patch reading CCUTIL_EXPORTS, CCUTIL_IMPORTS, CCUTIL_API.
Comment #3 on issue 614 by zde...@gmail.com: ccutil/strngs.h in r658 broke
STRING class DLL exporting on Windows builds
http://code.google.com/p/tesseract-ocr/issues/detail?id=614
in r689 as part of visibility patch