LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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: Bucharest
Distribution: Debian;Fedora
Posts: 63

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: 206Reputation: 206Reputation: 206
On Fedora 15, you need to install the gnome-libs-devel package, which provides gnomesupport.h.
 
Old 10-24-2011, 07:09 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
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: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
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
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
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: 547

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: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
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: Bucharest
Distribution: Debian;Fedora
Posts: 63

Original Poster
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: 1,598

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
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


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 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


All times are GMT -5. The time now is 11:57 PM.

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