wxPDFDocument - Which files to add to a project Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Post by evstevemd »

utelle wrote:
evstevemd wrote:Cannot Compile SVN. First I get a lot of warnings and then one error!

----------Build Started--------
C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe" -j 2 -f "MyProject_wsp.mk""
----------Building project:[ wxpdfdoc - DebugUnicode ]----------
mingw32-make.exe[1]: Entering directory `D:/Projects/MyProject/sdk/wxpdfdoc'
g++ -c "D:/Projects/MyProject/sdk/wxpdfdoc/src/pdfannotation.cpp" -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:\wxWidgets\lib\gcc_dll\mswud -IC:\wxWidgets\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -DWXMAKINGDLL_MYLIB -o ../../sdk/work/wxpdfdoc/src_pdfannotation.o "-I." "-I."
g++ -c "D:/Projects/MyProject/sdk/wxpdfdoc/src/pdfbarcode.cpp" -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:\wxWidgets\lib\gcc_dll\mswud -IC:\wxWidgets\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -DWXMAKINGDLL_MYLIB -o ../../sdk/work/wxpdfdoc/src_pdfbarcode.o "-I." "-I."
D:/Projects/MyProject/sdk/wxpdfdoc/src/pdfbarcode.cpp:27: warning: 'wxPdfBarCodeCreator::wxPdfBarCodeCreator(wxPdfDocument&)' redeclared without dllimport attribute: previous dllimport ignored
[...]
D:/Projects/MyProject/sdk/wxpdfdoc/src/pdfdecode.cpp:482: warning: 'void wxPdfLzwDecoder::AddStringToTable(int, char)' redeclared without dllimport attribute after being referenced with dll linkage
D:/Projects/MyProject/sdk/wxpdfdoc/src/pdfdecode.cpp:342: error: definition of static data member 'wxPdfLzwDecoder::ms_andTable' of dllimport'd class
mingw32-make.exe[1]: *** [../../sdk/work/wxpdfdoc/src_pdfdecode.o] Error 1
Well, you're mixing up library and DLL builds.

If you only define WXUSINGDLL - as you did -, this means you want to compile code which references wxPdfDocument compiled as a DLL. You can't compile wxPdfDocument itself that way.

If you want to compile wxPdfDocument itself as a library resp. as a DLL define WXMAKINGLIB_PDFDOC resp. WXMAKINGDLL_PDFDOC. In that context defining WXUSINGDLL means using a wxWidgets DLL build.

Regards,

Ulrich
hi Ulrich,
I want to compile it as static library. The whole wxWidgets is compiled as DLL. So which switch I use to compile wxPdfDoc as static library? Sorry I could not grasp what you said in post above!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
utelle
Moderator
Moderator
Posts: 1128
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

evstevemd wrote:I want to compile it as static library. The whole wxWidgets is compiled as DLL. So which switch I use to compile wxPdfDoc as static library? Sorry I could not grasp what you said in post above!
You need to define the following symbols:

WXMAKINGLIB_PDFDOC - create wxPdfDocument as static library
WXUSINGDLL - use wxWidgets built as DLL

Regards,

Ulrich
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Post by evstevemd »

I have spotted my error. i was using WXMAKINGDLL_MYLIB. I read your post again and found straight forward (forgive me I was may be too tired to understand). Changing that to WXMAKINGDLL_PDFDOC gave me a 17.6MB library in Unicode/debug mode. Hope it will be small in release mode! So far case is closed and thanks for your support!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply