Turning off graphics - Unable to initialize gtk Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
lincoder
Earned a small fee
Earned a small fee
Posts: 11
Joined: Tue Oct 17, 2006 3:09 pm

Turning off graphics - Unable to initialize gtk

Post by lincoder » Thu Oct 19, 2006 4:34 pm

Hi,

I am using gtk2-ansi-release-static-2.6 with g++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-54).

I have written an application which reads in a script file. Amongst other things, this script file can choose to display graphics, or choose not to. The application is an artificial life simulation and I use the graphical parts for testing during development (making sure animat does what its supposed to do).

I wish to run the simulation with graphics turned off on a cluster of remote machines. The problem is, is that I get the error:

Code: Select all

17:20:57: Error: Unable to initialize gtk, is DISPLAY set properly?
In other words, although I don't want any graphical windows displayed, gtk is still (perhaps understandably) called. Does anybody know how I might get around this problem without writing a seperate and hence gtk-less console application?

Lincoder

pidel
Experienced Solver
Experienced Solver
Posts: 89
Joined: Fri Sep 29, 2006 11:04 pm
Location: near Hamburg, Germany

Post by pidel » Thu Oct 19, 2006 9:50 pm

I
Systems: Mac OSX 10.4.8, OpenSuSE 10.2, WinXP SP2
wxWidgets: 2.8.0
IDE: KDevelop 3.3.4, Xcode 2.4, wxDev-C++ 6.10

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Fri Oct 20, 2006 1:07 pm

Pidel is right.
When you compile wx with GTK (or X) support, all app linked with will intend to initialise gtk.
So if you want to run an wxApp on a X-less platform, you must link it with wxBase.
Just modify env variables is not enough.
What is little and green, witch go up and down ??
Yoda playing with the force.

mhl_cz
In need of some credit
In need of some credit
Posts: 1
Joined: Sun Jan 11, 2009 10:49 am

Post by mhl_cz » Sun Jan 11, 2009 11:09 am

Hi, I'm writting app using wxSocketClient and wxSocketEvent. I need to run it on X-less platform.

At first I've tried to inherit from wxEvtHandler instead wxApp and I've used wxInitializer and wxSocketBase::Initialize() to init. However it has never got to OnSocketEvent(). So I replaced wxEvtHandler with wxApp and it worked. But only on X platform.

question #1 - it's possible to use wxSocketEvent without wxApp and how?

question #2 - if I'd have to use wxApp, will it work if I compile/link it against wxBase?

Post Reply