wxWidgets

hello everybody!

I want to learning the wxWidgets library [ http://www.wxwidgets.org/ ]
I have some problems with installing this library and compile a sample project

I install the following from /usr/ports :
1. wxgtk2-2.8.10_3
2. wxgtk2-common-2.8.10_3
3. wxgtk2-unicode-2.8.10_3

Sample project I get from http://wiki.wxwidgets.org/Hello_World
And I make a main.cpp:
Code:
include "HelloWorldApp.h"

int main()
{
HelloWorldApp &app = ::wxGetApp();
return 0;
}


When I launch the terminal and typing:
Code:
g++ HelloWorldApp.cpp `wx-config --libs` `wx-config --cxxflags` -o HelloWorldApp

there is occur the following:

Code:
wx-config: not found
wx-config: not found
HelloWorldApp.cpp:2:23: error: wx/wxprec.h: No such file or directory
HelloWorldApp.cpp:5:20: error: wx/wx.h: No such file or directory
In file included from HelloWorldApp.cpp:8:
HelloWorldApp.h:7: error: expected class-name before '{' token
HelloWorldApp.cpp:10: error: expected constructor, destructor, or type conversion before 'IMPLEMENT_APP'
In file included from main.cpp:1:
HelloWorldApp.h:7: error: expected class-name before '{' token
main.cpp:3: error: expected constructor, destructor, or type conversion before 'int'

Please, help me to correct it and how to install correct the wxWidgets
 
Try this:

Code:
$ g++ HelloWorldApp.cpp `wxgtk2u-2.8-config --libs` `wxgtk2u-2.8-config --cxxflags` -o HelloWorldApp

If it works, you can create a symbolic link in /usr/X11R6/bin:

Code:
# cd /usr/X11R6/bin
# ln wxgtk2u-2.8-config wx-config

From now on and you'll be able to use wx-config like it is described in the wiki article you've mentioned above.

Enjoy!

bsdmonk
 
I highly recommend compiling wxWidgets with --with-motif to get that truly authentic feel. (Your apps will look like crap though :D)

Actually, would anyone be interested in a wxMotif port?
 
Back
Top