Installing and running pbcompiler?

Linux specific forum
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Installing and running pbcompiler?

Post by dracflamloc »

When I try and compile the sprite.pb example i get this:

[root@localhost sources]# pbcompiler ./sprite.pb

******************************************
PureBasic Linux x86 v3.91
******************************************

Loading external modules...
Starting compilation...
47 lines processed.
Creating the executable.
sh: gtk-config: command not found
sh: gtk-config: command not found
Requester.a(MessageRequester.o)(.text+0xd): In function `PB_MessageRequester2':
: undefined reference to `gtk_dialog_new'
Requester.a(MessageRequester.o)(.text+0x1a): In function `PB_MessageRequester2':
: undefined reference to `gtk_label_new'
Requester.a(MessageRequester.o)(.text+0x2a): In function `PB_MessageRequester2':
: undefined reference to `gtk_window_get_type'
Requester.a(MessageRequester.o)(.text+0x33): In function `PB_MessageRequester2':
: undefined reference to `gtk_type_check_object_cast'
Requester.a(MessageRequester.o)(.text+0x3c): In function `PB_MessageRequester2':
: undefined reference to `gtk_window_set_title'
Requester.a(MessageRequester.o)(.text+0x48): In function `PB_MessageRequester2':
: undefined reference to `gtk_window_get_type'
Requester.a(MessageRequester.o)(.text+0x51): In function `PB_MessageRequester2':
: undefined reference to `gtk_type_check_object_cast'
Requester.a(MessageRequester.o)(.text+0x5a): In function `PB_MessageRequester2':
: undefined reference to `gtk_window_set_modal'
Requester.a(MessageRequester.o)(.text+0x6c): In function `PB_MessageRequester2':
: undefined reference to `gtk_widget_destroy'
GtkBase.a(GtkBase.o)(.text+0x1c): In function `PB_GtkBase_Init':
: undefined reference to `gtk_init'

...and many more...

collect2: ld returned 1 exit status

- Feel the ..PuRe.. Power -

sh: ./purebasic.exe: No such file or directory




How do I fix this and get it working. Seems like it's having a gtk issue
Last edited by dracflamloc on Thu Nov 11, 2004 6:06 pm, edited 1 time in total.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

did you install the right GTK (and SDL) packages?

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

hey dracflamloc, you could have trimmed some lines... :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Pbcompiler errors...

Post by BasicGuy »

When you install gtk, it creates a gtk-config file and writes it (usually) to either the /usr/local/lib or /usr/local/include directories. It can be found in other places depending on how you installed gtk. The gtk-config file contains all the info necessary for applications to link to the gtk libraries. That's why you got that long list of undefined references... :wink:
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Thanks for the replies. I'm not sure if I have the GTK/SDL libraries installed. I'm almost positive I have gtk though. I'm using fedora core 3 and I did the "everything install" of about 6 gb.

I'm a bit of a newbie to linux development outside of console C apps. Could you point me to where I can find the gtk libraries in case I don't have them? Also, if I already have the gtk-config file but pbcompiler doesn't find it, would I just create a link to the file in one of those places you mentioned it typically is?
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

Hmm, try typing these commands at the command prompt:

updatedb <enter>

...(wait until it completes)... then

locate gtk-config <enter>

Those two commands first update the locate database and then accesses it. If the gtk-config file is present, the locate command will tell you where it is. If it's there, type ldconfig -v to update the dynamic linker table. You should see some libraries with a libgtk prefix in the list.

If they're not there, check you install program. If you're using the KDE, you may not have installed the gtk libs. You can usually go back and installed them even though you're using the KDE.

I haven't used Fedora (I'm a minimalist Debian user) but most all distros behave the same way and the commands I mentioned are common to all Linux versions I know of. Give it a shot. 8)
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Thanks for the help guys I got it to work. =)

Now all I need is some sprite rotation code that works in linux.
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

Hmm, I thought I saw a Linux-based SDL sprite lib at the SDL homesite.... 8)
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

I just installed Fedora V3 too and get the same errors. When I tried to install more packages from the Fedora package installer thingy I get this error:

Image

I have both GNOME and KDE installed. Any tips? Remember I'm a newbie newbie newbie Linux user ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

What exactly are you attempting to install?
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Well, I only want the pbcompiler to work as I get the same error as the message posted as the first post.
I selected everything in the dev section apart from XFCE, no clue what that is.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

Well, what I get out of your screenshot is that you need to install the non-devel rpms before trying to install the devel packages..
But you don't need, for example, KDExx to get PureBasic to work..
Isn't there a way in Fedora to select individual packages you want to install??

And if it is: search/select libgktxx And libSDLxx ...

And if it's not, well you can try this.:

pop the cd /dvd in the drive.
open a terminal, su to root.
cd /path-to-where-the-rpms-are (/mnt/...)
rpm -U libgtk*.rpm
rpm -U libSDL*.rpm
(-U for upgrade incase some are installed..)
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Hi Ole.
I couldn't find the libs on the DVD. Maybe I missed something but I did look in the RPM folder on the disc. Anyways, I ran a bunch of rpm lib update things :lol: and now I cannot boot into Fedora anymore.

Now I get this error when trying to boot:

/usr/bin/rhgb-client: error loading shared libraries: libglib-2.0.so.0: cannot open shared object file: no such file or directory

Guess I should keep my hands of things I don't know about :shock: :?
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

you will need to find the rpm for gtk-dev (or gtk2-dev) and install them.
Fred - AlphaSND
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

And a good place to find the latest rpms are: http://rpmfind.net/

And I have to stand straight and take the beating here.. :cry:

In Fedora the files are:

gtk+-1.2*.rpm
gtk-devel-1.2*.rpm
gtk2-2.4*.rpm
gtk2-devel-2.4*.rpm
SDL-1.2.7*.rpm
SDL-devel-1.2.7*.rpm
Post Reply