Page 1 of 1
without gtk?
Posted: Sun Oct 03, 2010 2:12 pm
by Brujah
Is it possible at all to use purebasic without having gtk installed?
I used pb 4.20 before and my code worked.
Now I wanted to switch to the newest compiler (4.5.1) and it tells me it wants all the gtk libraries.
I use sdl commands only, as I want my game to run everywhere.
But it seems even if I open a window now I need gtk.
Is this right?
Re: without gtk?
Posted: Sun Oct 03, 2010 6:17 pm
by walker
If you use any of the gui commands (i.e. opening a window) or even use the Messagerequester, GTK librairies are used.
It could not be, that on previous versions no GTK libs are installed and using a window or messagerequester was possible... afaik since the first version of PB for linux GTK was used (in earlier Versions gtk1 from 4.0 on V2.0)
So if you didn´t change your distro in any way, the code running (and requesting libs) on 4.51 MUST request the same libs on 4.20
... if not... it´s another issue ... may you post the error output here
Re: without gtk?
Posted: Mon Oct 04, 2010 10:20 am
by Brujah
This is what the compiler gives me:
Code: Select all
62829 lines processed.
Creating the executable.
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
Error: Linker
Mouse.a(Mouse.o): In function `UnacquireMouse':
Mouse.c:(.text+0x59): undefined reference to `XUngrabPointer'
Mouse.c:(.text+0x6f): undefined reference to `XUndefineCursor'
Mouse.a(Mouse.o): In function `PB_ExamineMouse':
Mouse.c:(.text+0xf7): undefined reference to `XDefineCursor'
Mouse.c:(.text+0x141): undefined reference to `XGrabPointer'
Mouse.c:(.text+0x1b7): undefined reference to `XQueryPointer'
Mouse.c:(.text+0x213): undefined reference to `XWarpPointer'
Mouse.c:(.text+0x3b5): undefined reference to `XCreatePixmap'
Mouse.c:(.text+0x3df): undefined reference to `XCreateGC'
Mouse.c:(.text+0x415): undefined reference to `XFillRectangle'
Mouse.c:(.text+0x451): undefined reference to `XCreatePixmapCursor'
Mouse.c:(.text+0x45f): undefined reference to `XFreePixmap'
Mouse.c:(.text+0x471): undefined reference to `XFreeGC'
Mouse.a(Mouse.o): In function `PB_MouseLocate':
Mouse.c:(.text+0x54a): undefined reference to `XWarpPointer'
Screen.a(CloseScreen.o): In function `PB_CloseScreen':
CloseScreen.c:(.text+0x45): undefined reference to `gtk_widget_get_type'
CloseScreen.c:(.text+0x51): undefined reference to `g_type_check_instance_cast'
CloseScreen.c:(.text+0x59): undefined reference to `gtk_widget_destroy'
Screen.a(OpenWindowedScreen.o): In function `AutoStretchScreen':
OpenWindowedScreen.c:(.text+0x29): undefined reference to `gtk_widget_get_type'
OpenWindowedScreen.c:(.text+0x3a): undefined reference to `g_type_check_instance_cast'
OpenWindowedScreen.c:(.text+0x4a): undefined reference to `gtk_widget_set_size_request'
OpenWindowedScreen.c:(.text+0x9c): undefined reference to `XMoveWindow'
Screen.a(OpenWindowedScreen.o): In function `DestroyHandler':
OpenWindowedScreen.c:(.text+0xfc): undefined reference to `gtk_object_get_type'
OpenWindowedScreen.c:(.text+0x108): undefined reference to `g_type_check_instance_cast'
OpenWindowedScreen.c:(.text+0x130): undefined reference to `gtk_signal_compat_matched'
Screen.a(OpenWindowedScreen.o): In function `PB_OpenWindowedScreen2':
OpenWindowedScreen.c:(.text+0x1ba): undefined reference to `gtk_widget_get_type'
OpenWindowedScreen.c:(.text+0x1c2): undefined reference to `gtk_object_get_type'
OpenWindowedScreen.c:(.text+0x1d1): undefined reference to `g_type_check_instance_cast'
OpenWindowedScreen.c:(.text+0x1e1): undefined reference to `gtk_object_get_data'
OpenWindowedScreen.c:(.text+0x1f0): undefined reference to `g_type_check_instance_cast'
OpenWindowedScreen.c:(.text+0x208): undefined reference to `gtk_fixed_get_type'
OpenWindowedScreen.c:(.text+0x22b): undefined reference to `g_type_check_instance_is_a'
OpenWindowedScreen.c:(.text+0x27c): undefined reference to `g_type_check_instance_cast'
I just open a screen. No window.
I do not (knowingly) use gtk elements.
Re: without gtk?
Posted: Mon Oct 04, 2010 5:06 pm
by Guimauve
Brujah wrote:I just open a screen. No window.
I do not (knowingly) use gtk elements.
In fact the screen is a window. So GTK libraries are needed, even if you just want to open screen.
Best regards
Guimauve
Re: without gtk?
Posted: Mon Oct 04, 2010 6:59 pm
by Vera
Hi Brujah,
not that I knew a lot about GTK+ and how and where it has to be installed, but the compiler messages you posted are not uncommon to me.
I only get these messages when some kind of screen output is demanded, never for 'normal' windows. In this case I have to set the compiler option 'library subsystem' to : opengl and then it works fine.
Hopefully this already solves it for you as well (and make sure to write it in small letters).
Greetings ~ Vera
Re: without gtk?
Posted: Mon Oct 04, 2010 8:55 pm
by walker
sorry to be contrary ..
but using the subsystem "opengl" doesn´t change anything as he is using a
windowed screen .... (see compiler output)
here are all dev-libs missing....
Guessing you´re using LinuxMint (as shown in your signature) then there should be NO problem as I use LM by myself...
Just install all the -dev libs for GTK 2.0 sdl1.2 ... use
Code: Select all
sudo apt-get install build-essential libgtk2.0-dev libgnome2-dev libgnomeprintui2.2-dev libxine-dev libsdl1.2-dev libiodbc2-dev
hope, I did not missed a package ....
Re: without gtk?
Posted: Fri Oct 08, 2010 11:24 am
by Brujah
The point is I do not want to install the gtk libraries.
My game uses nothing that requires gtk I use sdl only.
It can't be that opening the screen requires gtk, as I did this with pb 4.20 as well without requiring to install the gtk-dev libs.
opengl is no option as well, as I want my game to run everywhere.
Re: without gtk?
Posted: Fri Oct 08, 2010 2:26 pm
by Brujah
I just downloaded the pb 4.20 compiler for linux from the museum and it compiled my game without requiring any gtk libs.
So this has definately changed.
Re: without gtk?
Posted: Fri Oct 08, 2010 4:26 pm
by freak
Just to clarify: Do you use OpenScreen() or OpenWindowedScreen() ?
If you use OpenScreen() only, then SDL and XLib should be enough. I will take a closer look.
Re: without gtk?
Posted: Sat Oct 09, 2010 4:51 pm
by Brujah
I use both. Depending on what the user wants to have.
Re: without gtk?
Posted: Sat Oct 09, 2010 4:55 pm
by ts-soft
OpenWindowedScreen() requires allways gtk, you can't use it without.
Re: without gtk?
Posted: Tue Oct 12, 2010 4:40 pm
by Brujah
When I use pb 4.20 openwindowedscreen does not require gtk!
If you don't believe me just try it.