LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Including other directories g++ & gtk (https://www.linuxquestions.org/questions/linux-newbie-8/including-other-directories-g-and-gtk-63955/)

The Yeti Lives 06-05-2003 10:50 PM

Including other directories g++ & gtk
 
Hello,
I am having a problem with compiling g++ with other directories. I am on a university server, so have no changing system rights.

Using glade, made source code and could get g++ to see and process files by writing

bash-2.05b$g++ main.cc -I/usr/include/gtk-1.2/ -I/usr/include/glib-1.2/ -I/usr/lib/glib/include/ -lgtk -lgdk -lglib

However, I forgot this won't compile other .cc files that main.cc needs.

So I tried to write a Makefile to include other files, and added the -I's and -l's to CXXFLAGS line, but g++ can't see them.

Can anybody help?

mhearn 06-06-2003 09:54 AM

Try installing GTK2 to a directory in your home area. GTK2/glib2 use pkg-config which automates a lot of this stuff. Also learn to use autotools. The GTK2 manual shows you how to build using pkg-config. That will let you build projects that don't need to touch the system.

The Yeti Lives 06-11-2003 08:21 PM

Cheers anyway, in the end I found out you can compile them together in shell window like bash-2.05b$g++ main.cc support.cc interface.cc -I/usr/include/gtk-1.2/ -I/usr/include/glib-1.2/ -I/usr/lib/glib/include/ -lgtk -lgdk -lglib.
This works fine. Lucky shell remembers previous inputs, or would be hell tedious.


All times are GMT -5. The time now is 12:00 AM.