LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-03-2009, 08:44 AM   #1
intens
Member
 
Registered: Jun 2003
Location: europe
Distribution: Slackware
Posts: 42

Rep: Reputation: 15
Problem building gtk+ programs on Slack 12.2


Hi

I hope someone here could give a hint in this:

Since I updated to Slack 12.2 I couldn't build GTK+ applications anymore (Sylpheed for example). As an example, when trying to compile this test program
Code:
#include <gtk/gtk.h>
int main(void) {
gtk_main_quit();
return 0;
}
using this commandline
Code:
gcc `pkg-config --libs --cflags gtk+-2.0` test.c
the following error is thrown:
Code:
/usr/lib/gcc/i486-slackware-linux/4.2.4/../../../libcairo.so: undefined reference to `png_set_expand_gray_1_2_4_to_8'
collect2: ld returned 1 exit status
The problem seems to be that libpng isn't linked, because
Code:
$ pkg-config --libs gtk+-2.0
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
I can fix it by adding libpng to the Required line in /usr/lib/pkgconfig/gtk+-2.0.pc manually, but that can't be the right way, can it?

Could somebody explain, what the problem could be?

This a complete Slack 12.2 installation...

thx
 
Old 01-03-2009, 08:56 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Works fine here, Slackware 12.2:

Code:
eha@darkstar:/work$ gcc `pkg-config --libs --cflags gtk+-2.0` test.c
eha@darkstar:/work$ file a.out 
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
And:
Code:
eha@darkstar:/work$ pkg-config --libs gtk+-2.0
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
Eric
 
Old 01-03-2009, 10:28 AM   #3
intens
Member
 
Registered: Jun 2003
Location: europe
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 15
Thank you, Eric, for trying that.

However I'm confused now... Probably something is messed up with my installation.
 
Old 01-03-2009, 10:39 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
s/Probably/For sure/

Eric
 
  


Reply



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
Building gtk+-2.10.8 but get a undefined reference to g_thread_gettime Haraldsh Linux - Software 5 03-13-2007 02:29 AM
GTK+ programs on Windows without having to install GTK+, GLib, etc Nylex Programming 2 02-19-2006 01:33 PM
Having trouble building and installing GTK+ Plz Help! Gormless Linux - Software 5 10-10-2004 09:26 PM
Problem adding programs to fluxbox menu in Slack 10 apc Slackware 2 07-28-2004 06:14 AM
Thai fonts problem in GTK 2 - slack 9.1 static_drc Slackware 5 01-05-2004 10:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration