So I compiled the wxWidgets as DLL with MSYS using as a reference this: http://www.wxwidgets.org/wiki/index.php ... MSYS-MinGW
and the last post in this topic (changing DLL=1 with SHARED =1): http://forums.wxwidgets.org/viewtopic.php?t=10121
this is the procedure I followed:
I created a new build directory
with MSYS I ran configure to 'configure' the custom built wxWidgets ( $ ../configure --with-msw --enable-debug )
I made the wx ( $ make SHARED=1)
I installed it into MSYS ( $ make install SHARED=1)
As a result I got ten dlls:
At this point I wanted to recompile an old project made with wxDev-C++ 6.10.2 (that uses the MingW compiler) to obtain a size reduced executable.
Firstable I tried putting WXUSINGDLL=1 in Tools->Complier Options->Add these commands to the Make Line:
But nothing changes: I get an .exe of 3MB that doesn' need the DLL (because I think it still links statically to the wxWidgets libraries)
Then i changed the ProjectApp.h from this:
Code: Select all
#ifndef __PROJECT1FRMApp_h__ #define __PROJECT1FRMApp_h__ #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include <wx/wx.h> #else #include <wx/wxprec.h> #endif
Code: Select all
#ifndef __PROJECT1FRMApp_h__ #define __PROJECT1FRMApp_h__ //I added the following line #define WXUSINGDLL #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include <wx/wx.h> #else #include <wx/wxprec.h> #endif
[Linker Error] undefined reference to `_imp___...'
Thiking that the problem is that the compiler can't find the DLLs I cut&pasted the ten DLLs I got from the compilation of wxWidgets first in C:\...\Dev-Cpp\lib and then in C:\...\Dev-Cpp\bin but nothing changes.
So what's wrong? Anybody could help me?
I tried a lot of searches in the forum but I did't find something that could explain the error.
P.S.My OS is Windows XP and the compiler used by wxDev-C++ is MingW