LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-24-2011, 04:49 AM   #1
mythcat
Member
 
Registered: Dec 2007
Location: Fălticeni, Romania
Distribution: Debian;Fedora
Posts: 77
Blog Entries: 1

Rep: Reputation: 15
c++ simple example not compiling under Fedora


Hi i make simple C++ example.
This example is compiling with :
Code:
gcc test-gnome.c -o test-gnome `gnome-config --cflags --libs gnomeui`
...but i got errors with this command:
Code:
$ gcc test-gnome.c -o test-gnome -I /usr/include/gnome-1.0/ -L /usr/include/gnome-1.0/
In file included from test-gnome.c:6:0:
/usr/include/gnome-1.0/gnome.h:12:26: fatal error: gnomesupport.h: No such file or directory
compilation terminated.
I search and i not find the file gnomesupport.h
I use Fedora 15.
Can you tell what it is , or what is wrong.
Also I want use -I /usr/include/gnome-1.0/ , because it is in many distro...
Is true ?
If you have additional infos about how to compile same source code in many distro , please tell me.
Thank you . Regards.
 
Old 10-24-2011, 04:53 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
On Fedora 15, you need to install the gnome-libs-devel package, which provides gnomesupport.h.
 
Old 10-24-2011, 07:09 AM   #3
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
g++ rather than gcc
 
1 members found this post helpful.
Old 10-24-2011, 07:55 AM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Anisha Kaul View Post
g++ rather than gcc
I thought that GNOME/GTK+ uses plain C.
 
Old 10-24-2011, 09:11 AM   #5
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Mine was a generic statement telling him that C++ needs g++.
Quote:
Originally Posted by mythcat View Post
c++ simple example not compiling under Fedora
 
1 members found this post helpful.
Old 10-24-2011, 02:42 PM   #6
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38
test-gnome.c is a c file. I hope. If its c++ change the ending to .cpp.

And jhwilliams got the anwser to your problem. Install the dev file.
 
Old 10-24-2011, 03:02 PM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Anisha Kaul View Post
Mine was a generic statement telling him that C++ needs g++.
Ah, I didn't pay much attention to the topic, I just noticed that he's using "gcc", the source file name ends in ".c", and it's a GNOME program (and GNOME programs are written in C).
 
Old 10-25-2011, 01:28 AM   #8
mythcat
Member
 
Registered: Dec 2007
Location: Fălticeni, Romania
Distribution: Debian;Fedora
Posts: 77

Original Poster
Blog Entries: 1

Rep: Reputation: 15
I have already the dev libs .
As I say :
Code:
gcc test-gnome.c -o test-gnome `gnome-config --cflags --libs gnomeui`
working fine.
My issue is about the way of compiling ... because i need to make this with :
Code:
-I /usr/include/gnome-1.0/ -L /usr/include/gnome-1.0/
The big question is way the first compiling line code ( ...--cflags) working well without gnomesupport.h and secondary compiling need this file ?
 
Old 10-25-2011, 02:38 AM   #9
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,871
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
That's what 'gnome-config --cflags --libs gnomeui' does. Test it from command line:

Code:
gnome-config --cflags --libs gnomeui
Another (perhaps more modern) approach would be using pkg-config:

Code:
pkg-config --cflags --libs libgnomeui-2.0
 
  


Reply

Tags
c++, programming



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 in compiling a simple module in fedora core 4 sanddune008 Linux - Kernel 3 11-24-2006 03:38 AM
compiling a simple program with qt fakie_flip Linux - Software 1 01-18-2006 01:33 AM
simple question about compiling Xiangbuilder Programming 3 07-24-2004 10:58 PM
Compiling a simple C++ program kbeaver Programming 27 02-06-2004 08:02 PM
Simple compiling question??? cameronknives Linux - General 5 02-10-2002 10:58 AM

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

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