Code::Blocks
Code::Blocks 10.05
Build wxWidgets if you haven't already done this.
cd wxWidgets (or whatever the folder with the source is called) mkdir buildGTK cd buildGTK ../configure make
We'll use the minimal project from the samples folder.
cd samples/minimal make
How to create a wxWidget sample app using CodeBlocks
- create an empty wxWidget project with the wizard
- right click the project in the management pane
- chose "Properties"
- check "This is a custom makefile"
- verify the makefiles-name (should be 'Makefile' in this case)
- make sure the execution folder point to where the makefile is
- close the "Properties" dialog
Note: path should be under the buildgtk folder i.e ../wxWidgets/buildgtk/samples/minimal
- right click the project in the management pane
- chose "Build options"
- open the "Make commands" tab (rightmost)
- fix the make commands (most likely need to remove '$target')
- close the dialog
- right click the project in the management pane
- click "Add files" or "Add files recursively"
- add the files you want to your project
- right click on project properties
- select "Build targets" tab
- correct execution working folder to point to location of binary
- correct output filename field to contain either a relative path or absolute path with filename
- save your project (via menu, context menu or ALT+SHIFT+S)
You should be able to build, run and debug the minimal sample app using CB.
Code::Blocks 8.02
This one is pretty simple and worked almost out of the box assuming that you already have set up wxWidgets and confirmed its function by typing wx-config --libs in a terminal. If it lists its libraries its working, if its spitting an error it, obviously, is not.
Create a new project, choose wxWidgets project.
Then go to Project -> Build options and replace whatever the wizard generated in both, Debug and Release -> Compiler settings -> Other options with
`wx-config --cxxflags`
and Debug/Release -> Linker settings -> Other linker options with
`wx-config --libs`
You can also set your global settings to use this. You can do this by going to Settings -> Compiler and Debugger and doing the configuration there. This way you don't have to reconfigure every single project you do.
Code::Blocks SVN Version
This one is pretty simple and worked almost out of the box assuming that you already have set up wxWidgets and confirmed its function by typing wx-config --libs in a terminal. If it lists its libraries its working, if its spitting an error it, obviously, is not.
Create a new project, choose wxWidgets project.
Then go to Project -> Build options and replace whatever the wizard generated in both, Debug and Release -> Compiler settings -> Other options with
`wx-config --cflags`
and Debug/Release -> Linker settings -> Other linker options with
`wx-config --libs`
You should be all set now :)