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 01-30-2010, 10:19 AM   #1
archShade
Member
 
Registered: Mar 2006
Location: Delft NL
Distribution: Debian; Slackware; windows 7
Posts: 218

Rep: Reputation: 53
adding gtk libraries to eclipse using C


So I decided to take my first steps into programming with C + gtk.

So far I have done
  1. I loaded eclipse and ensured I had the cdt package
  2. Created a new C/C++ project called "play"
  3. Added a new source file called "Playfullsrc.c"
  4. Added the following to paths and symbols (output of the command: pkg-config --cflags gtk+-2.0)
    Code:
    /usr/include/gtk-2.0
    /usr/lib/gtk-2.0/include 
    /usr/include/atk-1.0 
    /usr/include/cairo 
    /usr/include/pango-1.0 
    /usr/include/pixman-1 
    /usr/include/freetype2
    /usr/include/directfb 
    /usr/include/libpng12 
    /usr/include/glib-2.0 
    /usr/lib/glib-2.0/include
  5. added "/usr/lib/libgtk-x11-2.0.so" to GCC C Linker Libaries (I have cheacked and this file exists)

When I build the project I get the error message "cannot find -l/usr/lib/libgtk-x11-2.0.so play line 0 C/C++ Problem"

I have been following this tutorial: http://zetcode.com/articles/eclipsecdevelopment/

Have I missed something? Any help getting this working will be appreciated.
 
Old 01-31-2010, 04:46 AM   #2
carbonfiber
Member
 
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
You've probably messed up step 5. Does "it" look like this on your system: http://zetcode.com/articles/images/eclipselibraries.png ?
 
Old 01-31-2010, 08:49 AM   #3
archShade
Member
 
Registered: Mar 2006
Location: Delft NL
Distribution: Debian; Slackware; windows 7
Posts: 218

Original Poster
Rep: Reputation: 53
Thank you this was the problem. I should have added "gtk-x11-2.0"

I had tried
"libgtk-x11-2.0.so"
"libgtk-x11-2.0"
"/usr/lib/libgtk-x11-2.0.so"
and
"/usr/lib/libgtk-x11-2.0"
(at different times)

Anyway I have now but the correct line in and it works thank you.
 
  


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
Having trouble using the gtk libraries. debiant Programming 1 09-06-2006 05:53 AM
missing gtk+ libraries mystical_reality Linux - Software 2 10-01-2005 01:30 AM
GTK Libraries??? Kane635 Linux - Software 1 11-07-2004 10:23 PM
adding libraries shenoy Linux - Newbie 3 07-17-2004 08:42 AM
eclipse - motif or gtk spyghost Programming 2 09-19-2003 08:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:18 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