hi Ulrich,utelle wrote:Well, you're mixing up library and DLL builds.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
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
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!