User forums > Help
can't build wxWidgets GUI applications
(1/1)
scottgleason:
While trying out code::blocks 8.02 I was unable to create and run a simple wxWidgets project, not even an empty hello world window.
I created a new project, using the template. Added a panel and a few buttons but then it would not compile until I added $(wx-config --cxxflags) in various compiler options and $(wx-config --libs) in the corresponding linker options. But it still will not run.
I was able to build and run an example wxWidgets hello world program using the command line (in Ubuntu 7.10) but I'd really prefer an IDE environment.
Is there any example on how to set up code::blocks in Ubuntu with wxWidgets to develop GUI applications? I've been at this for a while and have started to run out of ideas. Any example will do, for starters all I'm looking for is to run a wxWidgets GUI from code::blocks.
Any suggestions would be really appreciated.
Thanks,
Scott
Jenna:
If you use the wizard for a wxWidgets project , the calls to "wx-config" are set correctly.
If you don't use any special libraries you should get a build log like this (with full commandline logging turned on):
--- Code: ----------------- Build: Debug in test ---------------
g++ -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -D__WXGTK__ -pthread -Wall -g -Iusr/include/ -c /tmp/test/testApp.cpp -o obj/Debug/testApp.o
g++ -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -D__WXGTK__ -pthread -Wall -g -Iusr/include/ -c /tmp/test/testMain.cpp -o obj/Debug/testMain.o
g++ -L/usr/lib/ -o bin/Debug/test obj/Debug/testApp.o obj/Debug/testMain.o -pthread -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8
Output size is 328,39 KB
Process terminated with status 0 (0 minutes, 6 seconds)
0 errors, 0 warnings
--- End code ---
In the global Compiler-settings there should only be the search-dirs for compiler, linker and resources be set (for me :"/usr/include", "/usr/lib" and again "/usr/include").
"wx-config" is called with backticks " ` ", that means something like this:
--- Code: ---`wx-config --cflags`
--- End code ---
.
Create a simple project with the wizzard, don't change anything (inspite of the projects name and path of course) and try it again.
It would be helpful if you could post the full commandline pasted from the Buil Log. Look here for a way to do it.
frankmail007:
I got the same problem under Mac OSX and windows.
- Under Mac OSX, the cxxflags is simply not showed in compiling log.
- Under Windows, if I used script generated by compiler, the cxxflags is also not shown.
- Under Windows, if I used wx-config.exe and I specified the compiler options `wx-config --cxxflags`, the cxxflags is also not shown.
- Under Windows, if I used wx-config.exe and I specified the compiler options `wx-config.exe --cxxflags`, it works. But this is not what I want because I have to change this option under other OS rather than Windows.
Tony:
I installed C::B on an EeePC 701 with Ubuntu 8.02.
When I create a new project (typically "Hello") with wxWidgets 2.8 and build it, the following message appears:
--- Quote ----------------- Build: Debug in Hello ---------------
Precompiling header: wx_pch.h
g++: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End quote ---
I cannot find what is wrong, can you help me?
Many thanks
Antonio
Navigation
[0] Message Index
Go to full version