Code::Blocks Forums

User forums => Help => Topic started by: Barking_Mad on April 21, 2008, 09:45:13 pm

Title: small wxWidgets project setup problem - solved
Post by: Barking_Mad on April 21, 2008, 09:45:13 pm
Im fairly new with linux dev enviroment set up, and am not too familiar with the filesystem yet.

Environment:
Linux Ubuntu 8.04 Hardy Heron
Code::Blocks 8.02 Feb 27 Build

Attempting to use the wxWidgets project template, however im having trouble building the project.

I have successfully compiled a wxWidget sample with
Code
 g++ `wx-config --cxxflags` `wx-config --libs` test.cpp

Code
wx-config --version-full: Version: 2.8.7.1

wx-config --list:

 Default config is gtk2-unicode-release-2.8

  Default config will be used for output

  Alternate matches:
    base-unicode-debug-2.8
    base-unicode-release-2.6
    base-unicode-release-2.8
    gtk2-unicode-debug-2.8
    gtk2-unicode-release-2.6

Attempting to compile through codeblocks i receive the "wx/setup.h: No such file or directory" error.

I have tried explicitly adding the search directories for wx 2.8 include headers to the compiler options and the wx directory to the lib options, however with the mass of linux directories and my lack of linux knowledge i cant seem to point the program at the right files.

wxWidgets was installed through the package manager and the terminal compile of the test.cpp worked fine, so i figure its my compiler setup within codeblocks IDE.

Anyone got any advice?
Title: Re: small wxWidgets project setup problem
Post by: Barking_Mad on April 23, 2008, 03:41:46 am
Problem solved  :D

Note to anyone having some issues with the wx project templates:

Edit the projects settings for the build options as follows. Change compiler settings from:

Code
`....*snip*... cflags`

to

`....*snip*...cxxflags`

The default project source is cpp but the compiler flags are set for c, this is why the source compiled outside CB but not inside a default project template.

Easy to overlook that heh.

see also http://wiki.wxwidgets.org/Wx-Config

and note:
Quote
Note that, while in 2.2 you could use '--cflags', using wxWidgets 2.4 and up you're required to use '--cxxflags' instead.