LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 07-13-2006, 06:05 AM   #1
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Rep: Reputation: 38
Linking problem


I am adding some code to a program and I want to have gtk in it. To compile I changed the make file. I added `pkg-config gtk+-2.0 --cflags --libs`to the -cflags and it works.

but when it comes to linking I get "....main.c:145: undefined reference to `gtk_init'"

Where should I add some instructions in the make file? If its there? LDFLAGS?

I am lost.


Im using
#include <gtk/gtk.h>

Last edited by kalleanka; 07-13-2006 at 06:19 AM.
 
Old 07-13-2006, 06:13 AM   #2
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Original Poster
Rep: Reputation: 38
OK as I understand I need a Path somewhere in make to the objectfiles for gtk.
 
Old 07-13-2006, 07:02 AM   #3
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Original Poster
Rep: Reputation: 38
Ok I solved it.


I added `pkg-config gtk+-2.0 --cflags --libs` in the LDFLAGS in the make file.

heh now I am happy!
 
  


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
Problem linking f77 and f90 object files Make problem (I think) TheBrick Programming 1 05-22-2006 06:17 AM
Linking Problem I think? gplacek Linux - Software 10 08-13-2004 07:01 PM
C++ Linking Problem acjt Programming 4 01-31-2004 08:48 AM
Problem linking Red Guy Programming 1 02-07-2003 03:52 AM
linking problem with ld ! gluon Programming 2 05-19-2002 01:59 PM


All times are GMT -5. The time now is 01:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration