wxWidget with codeblocks problem
wxWidget with codeblocks problem
Have instaled CodeBlocks and wxWidget 3.0.2 but still unable to start a wxWidget project, always geting this error mesages:
I don´t care about debug, as never using it, but release is a problem.
My OS is Windows, but it should be already clear because of the pics.
For building wxWidgets I have used the comandline from the wiki:
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 clean
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1
So after that some .a files apear in the lib folder, but the error mesage staied the same, as befor building.
The lib folder looks like that:
and the gcc_lib:
Posibly some .a files are mising?
Have used wxDev befor and had no problems, exept wxDev is outdated.
I don´t care about debug, as never using it, but release is a problem.
My OS is Windows, but it should be already clear because of the pics.
For building wxWidgets I have used the comandline from the wiki:
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 clean
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1
So after that some .a files apear in the lib folder, but the error mesage staied the same, as befor building.
The lib folder looks like that:
and the gcc_lib:
Posibly some .a files are mising?
Have used wxDev befor and had no problems, exept wxDev is outdated.
Re: wxWidget with codeblocks problem
Maybe this helps:
viewtopic.php?p=169501&sid=8b310aedd398 ... 93#p169501
viewtopic.php?p=169501&sid=8b310aedd398 ... 93#p169501
Use the source, Luke!
Re: wxWidget with codeblocks problem
By the way gtafan, if you want to use C++11, you should build wxWidgets in C++11 mode, e.g.
Code: Select all
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 CXXFLAGS="-std=gnu++11"
Re: wxWidget with codeblocks problem
And what about that clean stuff? Also if I remember right my CodeBlocks version has integrated mingW 4.9, so shouldn´t it be something like CXXFLAGS="-std=gcc++11"? Also on CB forum I was tolld that some .a files are mising.PB wrote:By the way gtafan, if you want to use C++11, you should build wxWidgets in C++11 mode, e.g.Code: Select all
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 CXXFLAGS="-std=gnu++11"
Re: wxWidget with codeblocks problem
The comandline there looks more or less like mine, exept that "-fno-keep-inline-dllexport", what that´s good for?doublemax wrote:Maybe this helps:
viewtopic.php?p=169501&sid=8b310aedd398 ... 93#p169501
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxWidget with codeblocks problem
Before diving into wxWidgets, you might want to make sure you have your compiler set up with codeblocks by making and running a console application.
1)From the menu, select "File->New->Project...".
2)In the resulting popup, select "Console application". Then hit the "Go" button. This will start a wizard.
3)On the first 2 pages, just hit next. On the third page, enter a name for the project. On the 4th page, make sure you have "GNU GCC Compiler" selected. Then hit the finish button. 4)From the menu, select "Build->Build and run".
If that runs without problem, then codeblocks is set up with your compiler. If not, you need to take some extra steps to do that.
1)From the menu, select "File->New->Project...".
2)In the resulting popup, select "Console application". Then hit the "Go" button. This will start a wizard.
3)On the first 2 pages, just hit next. On the third page, enter a name for the project. On the 4th page, make sure you have "GNU GCC Compiler" selected. Then hit the finish button. 4)From the menu, select "Build->Build and run".
If that runs without problem, then codeblocks is set up with your compiler. If not, you need to take some extra steps to do that.
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxWidget with codeblocks problem
Before building a wxWidgets application in codeblocks, you should set a wx global variable in codeblocks.
1) From the menu, select "Settings->Global variables..."
2) In the resulting popup, hit new. That will start a second popup.
3) In that second popup, enter "wx" and hit OK.
4) Back in the first popup, select the base field, and enter the root location of your wxWidgets files. (The folder that contains build, include, lib, etc). 5) Then hit close.
1) From the menu, select "Settings->Global variables..."
2) In the resulting popup, hit new. That will start a second popup.
3) In that second popup, enter "wx" and hit OK.
4) Back in the first popup, select the base field, and enter the root location of your wxWidgets files. (The folder that contains build, include, lib, etc). 5) Then hit close.
Re: wxWidget with codeblocks problem
I assume that everyone knows that one should clean the previous build remnants so it does not need to be said.gtafan wrote: And what about that clean stuff? Also if I remember right my CodeBlocks version has integrated mingW 4.9, so shouldn´t it be something like CXXFLAGS="-std=gcc++11"?
I would also recommend using newer compiler, such as MinGW 5.3 but perhaps 4.9 is good enough for C++11.
Older wxWidgets and MinGW have problems when compiling in standard C+11 mode due to bugs in MinGW. The issue has been resolved for now, at least for wxWIdgets GIT head but who knows when it breaks again. Either way, wxWIdgets documentation clearly states that -std=gnu++11 should be used instead of std=c++11 (which I assumed you meant by std=gcc++11).
See e.g. here for recent discussion regarding the topic: https://groups.google.com/d/msg/wx-user ... YKLYkbAgAJ
Last edited by PB on Wed Apr 05, 2017 3:07 pm, edited 1 time in total.
Re: wxWidget with codeblocks problem
FYI: There is no reason to think the OP actually built wxWidgets successfully; I tried help him/her on the Code::Blocks forum and they will NOT post any information needed to confirm the wxWidgets was built!
Tim S.
Tim S.
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxWidget with codeblocks problem
If those first 2 steps are completed, you're now ready to try to build a wxWidgets application.
1)From the menu, select "File->New->Project...".
2)In the resulting popup, select "wxWidgets project". Then hit the "Go" button. Again, this will start a wizard.
3)
1)From the menu, select "File->New->Project...".
2)In the resulting popup, select "wxWidgets project". Then hit the "Go" button. Again, this will start a wizard.
3)
- On the first page, just hit next.
- On the second page, pick your wxWidgets version.
- On the third page, enter a project title
- Enter whatever you want on the forth page.
- Pick a GUI builder and application type on the 5th page. For now, you probably want to use "wxSmith" for the builder and "Frame based" for the application type. Later, you might want to try wxFormbuilder.
- On the 6th page, enter "$(#wx)" for wxWidgets location. This is important.
- On the 7th page, as with the console application, make sure "GNU GCC Compiler" is selected. If you haven't build a debug version of the library, uncheck "Create Debug configuration".
- The 8th page is the most important one. You need to make sure the settings you enter here match the version of the wxWidgets library you have built. Given the settings you mentioned above, you should enter these settings on this page:
- Hit the finish button.
Re: wxWidget with codeblocks problem
The "Console application" was the first I tried and it worcked. I have the latest version of CB with buildin compiler. I think it´s mingW 4.9, but not 100% shure about that.New Pagodi wrote:Before diving into wxWidgets, you might want to make sure you have your compiler set up with codeblocks by making and running a console application.
1)From the menu, select "File->New->Project...".
2)In the resulting popup, select "Console application". Then hit the "Go" button. This will start a wizard.
3)On the first 2 pages, just hit next. On the third page, enter a name for the project. On the 4th page, make sure you have "GNU GCC Compiler" selected. Then hit the finish button. 4)From the menu, select "Build->Build and run".
If that runs without problem, then codeblocks is set up with your compiler. If not, you need to take some extra steps to do that.
Re: wxWidget with codeblocks problem
Why do I have to use global variables? Why not just select the right path in the CB wizard? Why can I do it the way I have done here?:New Pagodi wrote:Before building a wxWidgets application in codeblocks, you should set a wx global variable in codeblocks.
1) From the menu, select "Settings->Global variables..."
2) In the resulting popup, hit new. That will start a second popup.
3) In that second popup, enter "wx" and hit OK.
4) Back in the first popup, select the base field, and enter the root location of your wxWidgets files. (The folder that contains build, include, lib, etc). 5) Then hit close.
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxWidget with codeblocks problem
If you use the global wx variable, when you update the wxWidgets library, you only have to update the global variable and all projects will continue to work with the new wxWidgets version.
If you use the specific location in the wizard, if you update the wxWidgets library, you'll have to update many settings in every single project.
If you use the specific location in the wizard, if you update the wxWidgets library, you'll have to update many settings in every single project.
Re: wxWidget with codeblocks problem
@New Pagodi
As we get so many posts with C:B and MinGW related problems, could you make one post that summarizes it all? Then we could make it sticky so that hopefully more people find it.
As we get so many posts with C:B and MinGW related problems, could you make one post that summarizes it all? Then we could make it sticky so that hopefully more people find it.
Use the source, Luke!
Re: wxWidget with codeblocks problem
I know about problems with updating the wxWidgets library, but I don´t care about that, as I am not going to update wxWidgets library next time. At the moment it´s my only goal to build a wxWidget GUI that is compatible with my C++11 code.New Pagodi wrote:If you use the global wx variable, when you update the wxWidgets library, you only have to update the global variable and all projects will continue to work with the new wxWidgets version.
If you use the specific location in the wizard, if you update the wxWidgets library, you'll have to update many settings in every single project.
Till now I have worcked only with IDEs having some kind of plugin system, so I naever had to build some libraries on comandline, but this fact not making me troll, like Tim think.