LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2003, 11:50 PM   #1
The Yeti Lives
LQ Newbie
 
Registered: May 2003
Posts: 13

Rep: Reputation: 0
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?
 
Old 06-06-2003, 10:54 AM   #2
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 47
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.
 
Old 06-11-2003, 09:21 PM   #3
The Yeti Lives
LQ Newbie
 
Registered: May 2003
Posts: 13

Original Poster
Rep: Reputation: 0
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.
 
  


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
How to install QT&GTK* without GNOME & KDE? VertX Debian 2 02-15-2005 02:27 PM
Glib & GTK+ versions 1.2.10 & 2.4.0 RaVilj Linux - Software 9 06-18-2004 06:30 PM
How to make a image file for my disk( Including win2000&Redhat Linux system)? teradyne Linux - Software 3 06-02-2004 05:25 AM
Tar including all parent directories? everythingand2 Linux - General 4 12-14-2003 07:31 PM
Need help with directories & files GoboFraggle Programming 4 04-09-2003 07:04 AM


All times are GMT -5. The time now is 02:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration