Hi to all.
I've got a little problem while building an application with wx-2.9.3.
This application is made of a shared lib and an executable.
I've added the last wxPdfDoc's sources and headers to the lib's one, and added "WXMAKINGDLL_PDFDOC" to the compiler and the linker options.
If I build it with wx-2.8.12, no problem : the wxPdfDoc is available in the lib.
If I build it with wx-2.9.3, there are no symbols of wxPdfDoc exported.
The settings for both wx-2.8.12 and wx-2.9.3 are the same (I just added wxDEBUG_LEVEL=0 for wx-2.9.3).
I added the option for creating the static lib file : the wx-2.8.12 has a size of about 2Mo, the wx-2.9.3 one is about 430Ko
Windows 7 - Code::Blocks Nightly-Build - gcc-4.5.2-TDM - wx-2.9.3-32bits (not tested yet with 64bits).
Did I missed something ? Is there an option that must be added for building with wx-2.9.3 ?
Thanks in advance for the replies.
Regards
Xav'
wxPdfDoc-0.9.2.1 & wx-2.9.3 Topic is solved
- xaviou
- Super wx Problem Solver
- Posts: 437
- Joined: Mon Aug 21, 2006 3:18 pm
- Location: Annecy - France
- Contact:
wxPdfDoc-0.9.2.1 & wx-2.9.3
My wxWidgets stuff web page : X@v's wxStuff
Re: wxPdfDoc-0.9.2.1 & wx-2.9.3
Most probably there is a difference otherwise the symbols would not be missing. There are no known compile issues for wxPdfDocument used with wxWidgets 2.9.x. If WXMAKINGDLL_PDFDOC is defined the symbol WXEXPORT defined by wxWidgets itself is referenced. Maybe the symbol WXEXPORT is incorrectly defined due to other settings. Please show all settings you have defined.xaviou wrote:I've got a little problem while building an application with wx-2.9.3.
This application is made of a shared lib and an executable.
I've added the last wxPdfDoc's sources and headers to the lib's one, and added "WXMAKINGDLL_PDFDOC" to the compiler and the linker options.
If I build it with wx-2.8.12, no problem : the wxPdfDoc is available in the lib.
If I build it with wx-2.9.3, there are no symbols of wxPdfDoc exported.
The settings for both wx-2.8.12 and wx-2.9.3 are the same (I just added wxDEBUG_LEVEL=0 for wx-2.9.3).
Are you sure your project references all source files belonging to wxPdfDocument? 430 kB definitely sounds way too small.xaviou wrote:I added the option for creating the static lib file : the wx-2.8.12 has a size of about 2Mo, the wx-2.9.3 one is about 430Ko
As I don't use Code::Blocks myself I can't tell much about Code::Block specifics, but I can tell you that there are no special symbols required for building wxPdfDocument for wxWidgets 2.9.3.xaviou wrote:Windows 7 - Code::Blocks Nightly-Build - gcc-4.5.2-TDM - wx-2.9.3-32bits (not tested yet with 64bits).
Did I missed something ? Is there an option that must be added for building with wx-2.9.3 ?
Regards,
Ulrich
- xaviou
- Super wx Problem Solver
- Posts: 437
- Joined: Mon Aug 21, 2006 3:18 pm
- Location: Annecy - France
- Contact:
Re: wxPdfDoc-0.9.2.1 & wx-2.9.3
Hi
With this block of code : all is ok : the shared and the static libs have the wxPdfDoc symbols exported.
Here are the settings fo the project :
I'll try to see why this WXEXPORT symbol is not defined correctly.
Thank-you for your reply
Regards
Xav'
It seems to be a WXEXPORT problem : to clarify this, I tried adding the folowing lines in "pdfdocdef.h" :utelle wrote:Maybe the symbol WXEXPORT is incorrectly defined due to other settings. Please show all settings you have defined.
Code: Select all
#if EXPORT_LIB // a private define for the other symbols of my shared lib
#ifdef WXEXPORT
#undef WXEXPORT
#define WXEXPORT __declspec (dllexport)
#endif
#else
#ifdef WXIMPORT
#undef WXIMPORT
#define WXIMPORT __declspec (dllimport)
#endif
#endif
Here are the settings fo the project :
- __GNUWIN32__ : building with gcc-4.5.2-TDM
- __WXMSW__ : I'm working under Windows
- WXUSINGDLL : Using the shared multi-libs version of wxWidgets
- wxUSE_UNICODE
- EXPORT_LIB : the "export" define for the other stuff in my lib
- WXMAKINGDLL_PDFDOC : sources of wxPdfDoc are include in my lib, so it's like if I was byuilding the dll of wxPdfDoc
- -Wall, -pipe, -mthreads
- wxDEBUG_LEVEL=0 : to avoid the "undefined reference to wxAssertHandler"-like errors at link time.
I'm sure : the dll has a size of more than 3.4 Mo. Only the ".a" file is 430Ko (and it comes to more than 2Mo with the block above).utelle wrote:Are you sure your project references all source files belonging to wxPdfDocument? 430 kB definitely sounds way too small.xaviou wrote:I added the option for creating the static lib file : the wx-2.8.12 has a size of about 2Mo, the wx-2.9.3 one is about 430Ko
I'll try to see why this WXEXPORT symbol is not defined correctly.
Thank-you for your reply
Regards
Xav'
My wxWidgets stuff web page : X@v's wxStuff
Re: wxPdfDoc-0.9.2.1 & wx-2.9.3
This seems to be a problem caused by changes in the wxWidgets header file dlimpexp.h introduced in wxWidgets version 2.9.2 for GCC version 4.5 and above. For this compiler the symbols WXEXPORT and WXIMPORT are no longer defined. There is a comment readingxaviou wrote:It seems to be a WXEXPORT problem : to clarify this, I tried adding the folowing lines in "pdfdocdef.h" :With this block of code : all is ok : the shared and the static libs have the wxPdfDoc symbols exported.Code: Select all
#if EXPORT_LIB // a private define for the other symbols of my shared lib #ifdef WXEXPORT #undef WXEXPORT #define WXEXPORT __declspec (dllexport) #endif #else #ifdef WXIMPORT #undef WXIMPORT #define WXIMPORT __declspec (dllimport) #endif #endif
Maybe one needs to do something to enable this auto export/import feature. Since I use Visual C++ and not GCC under Windows I can't give further advise unfortunately.While gcc also supports __declspec(dllexport), it creates unusably huge
DLL files since gcc 4.5 (while taking horribly long amounts of time),
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601. Because of this
we rely on binutils auto export/import support which seems to work
quite well for 4.5+.
Regards,
Ulrich
- xaviou
- Super wx Problem Solver
- Posts: 437
- Joined: Mon Aug 21, 2006 3:18 pm
- Location: Annecy - France
- Contact:
Re: wxPdfDoc-0.9.2.1 & wx-2.9.3
Hi
I finally got it to work :
The "auto-export" feature of gcc is enabled by default.
But it is disabled if any "__declspec(dllexport)" is used in the lib (that was my case).
And to use the "auto-import" functionnality, I just had to directly link to the dll file instead of the ".a" file.
Thanks again for you replies.
Edit : Successfully build with wx-2.9.3-64 bits. Just 2 problems encountered in pdfbarcode.cpp (errors for conversion from wxUniChar to long long int):
Regards
Xav'
I finally got it to work :
The "auto-export" feature of gcc is enabled by default.
But it is disabled if any "__declspec(dllexport)" is used in the lib (that was my case).
And to use the "auto-import" functionnality, I just had to directly link to the dll file instead of the ".a" file.
Thanks again for you replies.
Edit : Successfully build with wx-2.9.3-64 bits. Just 2 problems encountered in pdfbarcode.cpp (errors for conversion from wxUniChar to long long int):
Code: Select all
// line 334 : replaced
codeExt += code39_encode[code[i]];
// by
codeExt += code39_encode[(int)code[i]];
// Line 1398 : replaced
bars = code128_bars[*ch];
// by
bars = code128_bars[(int)*ch];
Xav'
My wxWidgets stuff web page : X@v's wxStuff