LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linking problem (https://www.linuxquestions.org/questions/programming-9/linking-problem-463600/)

kalleanka 07-13-2006 06:05 AM

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>

kalleanka 07-13-2006 06:13 AM

OK as I understand I need a Path somewhere in make to the objectfiles for gtk.

kalleanka 07-13-2006 07:02 AM

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!


All times are GMT -5. The time now is 10:34 PM.