LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-16-2011, 11:16 PM   #1
avee137
Member
 
Registered: Apr 2010
Location: bangalore,india
Distribution: ubuntu 9.10,CentOS 5
Posts: 120

Rep: Reputation: 16
error in #include<glib.h>


hi,

I need to use glib.h for my program. When i compile a sample code like this.
Code:
#include<glib.h>
#include<dbus/dbus-glib.h>


int main(){

return 0;
}
I get following error :

Code:
sccc@ubuntu:~/poc/dbus/glibSend$ gcc demo.c -o demo
demo.c:1:17: fatal error: glib.h: No such file or directory
compilation terminated.
Any clue about how to proceed ??

Any relevant help would be greatly appreciated.
 
Old 11-17-2011, 12:13 AM   #2
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hi.
Read this.
I was able to compile your sample code with the following command:
Code:
gcc `pkg-config --cflags --libs glib-2.0 dbus-glib-1` demo.c
Hope this helps.
 
Old 11-17-2011, 02:53 AM   #3
avee137
Member
 
Registered: Apr 2010
Location: bangalore,india
Distribution: ubuntu 9.10,CentOS 5
Posts: 120

Original Poster
Rep: Reputation: 16
Thanks, it worked.
 
  


Reply



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
xmms install (needs glib>1.22), just installed glib 2.4.8 and still get error message eskiled Linux - Software 2 12-19-2005 09:12 PM
multiple #include 'Error' Hady Programming 6 02-07-2004 09:53 AM
How do I include the error message? Budha Linux - Newbie 7 10-18-2003 01:29 AM
Glib error LinuxBAH Linux - General 11 07-07-2003 05:03 AM
#include <iostream> ERROR alexrm1x Programming 9 03-14-2003 10:04 AM

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

All times are GMT -5. The time now is 10:48 AM.

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