Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-30-2003, 03:41 AM   #1
Registered: Jul 2003
Distribution: SUSE 9.0 Pro
Posts: 45

Rep: Reputation: 15


has anyone here played with wxWindows? Ive got it to work on windows, but im struggling to get it working under linux.

Im using SUSE 9.0 and i think ive installed all the packages i need (i compiled wxGTK with a ./configure, ./make, ./make install). No errors occured when i compiled wxGTK, its just when i try to compile something that references wx.h
Old 10-30-2003, 05:43 AM   #2
Registered: Oct 2003
Location: Australia
Distribution: Redhat 9
Posts: 95

Rep: Reputation: 15
I have not used wxWindows, but do you get link errors? Have you linked in the wxWindows libraries and any other dependent libs?

use -L<path_to_required_libs> -l<lib_name>

And have you added the include path also?

-I<path to include files>

I have wxWindows (GTK version) installed, but have not used it. I see that the shared lib is located (by default) in:


And the header files are located in:


g++ sourcefile.cpp -I/usr/local/include/wx -L/usr/local/lib -lwx_gtk2.4
if you include the include files using the wx prefix, then drop the wx prefix in the include path:


in you code you have: #include <wx/wx.h>
opposed to: #include <wx.h>

then adjust the compile line to :

g++ sourcefile.cpp -I/usr/local/include -L/usr/local/lib -lwx_gtk2.4
Infact /usr/local/include might already be in your search path, so it might not be needed at all..

As a rule, if you want to get good help for any problem, you need to give a lot more info about the errors you have (ie post the compiler output), saves people having to guess whats wrong

Hope that helps..

Last edited by mr_segfault; 10-30-2003 at 05:45 AM.
Old 10-31-2003, 05:09 AM   #3
Registered: Jul 2003
Distribution: SUSE 9.0 Pro
Posts: 45

Original Poster
Rep: Reputation: 15

thanks for the reply.

I have more details now as im actually sat on the linux box

This is the start of the output from the make command:

mark@suse:~/Documents/Development/Hello> make
g++ -c HelloWorld.cpp -o hw.o
In file included from /usr/local/include/wx/defs.h:23,
from /usr/local/include/wx/wx.h:15,
from HelloWorld.cpp:4:
/usr/local/include/wx/platform.h:85:22: wx/setup.h: No such file or directory
In file included from /usr/local/include/wx/platform.h:88,
from /usr/local/include/wx/defs.h:23,
from /usr/local/include/wx/wx.h:15,
from HelloWorld.cpp:4:
/usr/local/include/wx/chkconf.h:47:9: #error "wxUSE_DYNLIB_CLASS must be defined."
/usr/local/include/wx/chkconf.h:55:9: #error "wxUSE_FILESYSTEM must be defined."
/usr/local/include/wx/chkconf.h:68:9: #error "wxUSE_DYNAMIC_LOADER must be defined."
/usr/local/include/wx/chkconf.h:76:9: #error "wxUSE_LOG must be defined."
/usr/local/include/wx/chkconf.h:84:9: #error "wxUSE_LONGLONG must be defined."

My makefile looks like this:

# Makefile for Hello World

# To execute clean even if a file called clean exists
.PHONY: clean

# Variables
CFLAGS = -O0 -Wall -time # For debug
#CFLAGS = -O3 -time # For release
CC = g++

# Objects to get linked
OBJECTS = hw.o

# Main compilation routine
$(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) -I/usr/local/include -L/usr/local/lib -lwx_gtk2.4

# Compile objects
hw.o: HelloWorld.cpp HelloWorld.h
g++ -c HelloWorld.cpp -o hw.o

# Clean directory
rm -frv *.o hw

Any help much appreciated!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
installing wxWindows vickr1z Linux - Newbie 3 02-22-2014 11:27 PM
wxWindows - lmule phoenix_wolf Linux - Newbie 4 01-05-2005 12:27 PM
WxWindows and MingW Genjix Programming 0 01-01-2005 05:35 AM
wxWindows JurajPsycho Programming 6 10-17-2004 05:01 AM
wxWindows linking karlan Programming 0 07-28-2004 11:02 PM

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration