Issue 614 in tesseract-ocr: ccutil/strngs.h in r658 broke STRING class DLL exporting on Windows builds

5 views
Skip to first unread message

tesser...@googlecode.com

unread,
Feb 10, 2012, 5:44:33 PM2/10/12
to tesserac...@googlegroups.com
Status: New
Owner: ----

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


tesser...@googlecode.com

unread,
Feb 17, 2012, 11:09:10 PM2/17/12
to tesserac...@googlegroups.com

Comment #1 on 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

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.

tesser...@googlecode.com

unread,
Feb 19, 2012, 4:55:38 PM2/19/12
to tesserac...@googlegroups.com

Comment #2 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

I put back "class CCUTIL_API STRING". I keep issue open for further
discussion(?)/patch reading CCUTIL_EXPORTS, CCUTIL_IMPORTS, CCUTIL_API.

tesser...@googlecode.com

unread,
Mar 2, 2012, 12:55:04 PM3/2/12
to tesserac...@googlegroups.com
Updates:
Status: Fixed

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

Reply all
Reply to author
Forward
0 new messages