Code::Blocks Forums
User forums => Help => Topic started by: barbarello on January 06, 2006, 07:45:37 pm
-
Hi all,
I'm working with
CODEBLOCKS 1.0RC2
wxWidgets 2.6.2
When i create a wxFrame, it's work (compilation and execution) correctly
But if i create a wxDialog, the compilation return 0 error but the execution of exe file send a messagebox :
The entry point _ZN8wxDialog17MSWProcessMessageEP6tagMSG not found in lib wxmsw26_gcc_cb.dll
Here the code
#include <wx/wx.h>
class MainApp:public wxApp //declaration d'application - conteneur de fenêtre
{
public:
virtual bool OnInit();
};
class MainClass:public wxDialog //declaration de fenêtre - conteneur des éléments de fenêtre
{
public:
MainClass(const wxString &title,const wxPoint &pos,const wxSize &size);
};
IMPLEMENT_APP(MainApp) //creation de l'instance de l'application
bool MainApp::OnInit()
{
MainClass *window=new MainClass("Titre de fenêtre",wxPoint(250,250),wxSize(350,250));
window->Show(true);
SetTopWindow(window);
return true;
}
MainClass::MainClass(const wxString &title,const wxPoint &pos,const wxSize &size)
:wxDialog((wxDialog*)NULL,-1,title,pos,size)
{
}
If anybody knows this problem.....
Thanks for helping
-
Linking against the wxWidgets dll coming with Code::Blocks (wxmsw26_gcc_cb.dll) is no good.
You should build wxWidgets yourself from source (or, if you don't want to do that, try the DevPak).
Building from sources takes a few minutes, but it is the recommended way.
Also, make sure that you use the correct compiler include paths.
If you compile with some arbitrary setup.h that is lying around somewhere in your path, then you won't get anywhere either - the libraries and headers (particularly setup.h) should always be from the same wxWidgets build.
Exception:
The above is not correct if you want to build a plugin. When building a plugin, you must link against the same wxWidgets library that was used to build Code::Blocks. In that case, download the SDK because you need the import libraries to be able to do so.
-
Thanks
I've used this link http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29 (http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29)
to configure CODEBLOCKS for wxWIDGETS.
I've tried to recompile with options : mingw32-make -f makefile.gcc USE_XRC=1 SHARED=0 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb as i've found in this forum but I have now many errors during the compilation.
Excuses me, my English is very poor and i've not understood what you explain to me with SETUP.H file :oops:
-
Hello,
May be this (http://forums.codeblocks.org/index.php?topic=1701.0) could help.
Michael
-
OK it's resolved !!
As it's write on link : http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29 (http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29)
I put wxmsw26_gcc_cb.dll in C:\windows\system32
It works !
So after deleting it I add C:\<My_Folder_WXwidgets>\lib\codeblocks to compile -> compiler options -> programs -> additional paths
recompile...
It is OK
Thanks all for helping !
-
Thomas: Mind copying that page of yours to the wiki?
-
I put wxmsw26_gcc_cb.dll in C:\windows\system32
I would advice not to put the wxmsw26_gcc_cb.dll in C:\windows\system32, but to add its path to the system path (environmental variable). IMHO this is a better solution.
Michael
-
I put wxmsw26_gcc_cb.dll in C:\windows\system32
It works !
Bad idea. This can lead to DLL hell (http://en.wikipedia.org/wiki/Dll_hell). Even it if seems to work now, this can cause a problem at a later time, and you will not know what went wrong.
-
yes i'm agree....and realize this yesterday :
So after deleting it I add C:\<My_Folder_WXwidgets>\lib\codeblocks to compile -> compiler options -> programs -> additional paths
recompile...
without the DLL, problem is the same
but i've spend more than a week to try to configure DEV-CPP, wxDEV-CPP and now CodeBlocks.
I need to work for my project and not on the tools.
Sure I will have the same problem problem later, and i imagine it's due to my compilation parameters.....
So....i will be back on this forum soon.... :)
Thanks all