LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

Rep: Reputation: 15
wxWindows


Hi,

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
mr_segfault
Member
 
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:

/usr/local/lib/libwx_gtk2.4.so

And the header files are located in:

/usr/local/include/wx

so:
Code:
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:

eg:

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

then adjust the compile line to :

Code:
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
Skute
Member
 
Registered: Jul 2003
Distribution: SUSE 9.0 Pro
Posts: 45

Original Poster
Rep: Reputation: 15
Hi,

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++
TARGET = hw

# Objects to get linked
OBJECTS = hw.o

# Main compilation routine
$(TARGET): $(OBJECTS)
$(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
clean:
rm -frv *.o hw




Any help much appreciated!
 
  


Reply


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 11:57 AM.

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