LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-06-2012, 03:59 AM   #1
Sarvendu
LQ Newbie
 
Registered: Aug 2012
Posts: 9

Rep: Reputation: Disabled
g++: error: pkg-config --libs --cflags gtkmm-2.4: No such file or directory


I just step in into linix GUI development. I downloaded gtkmm-2.4. I wrote a simple program as follows:

#include <gtkmm.h>

int main (int argc, char **v){
Gtk::Main kit(argc, argv);

Gtk:: Window window;

window.set_default_size(600,360);

Gtk::Main::run(window);
return 0;
}

Whenever, i am trying to compile it from terminal using g++ Main.cpp -o main 'pkg-config --libs --cflags gtkmm-2.4' command, i am receiving "g++: error: pkg-config --libs --cflags gtkmm-2.4: No such file or directory" error.
I am using "Ubuntu 12.04 LTS". I installed gtk using following command from terminal

sudo apt-get install build-essential libgtkmm-2.4.dev -y

I also verified the package config using pkg-config gtkmm-2.4 --cflags command and i receive following output in the terminal

-pthread -I/usr/include/gtkmm-2.4 -I/usr/lib/i386-linux-gnu/gtkmm-2.4/include -I/usr/include/atkmm-1.6 -I/usr/include/giomm-2.4 -I/usr/lib/i386-linux-gnu/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/i386-linux-gnu/pangomm-1.4/include -I/usr/include/gtk-2.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gdkmm-2.4 -I/usr/lib/i386-linux-gnu/gdkmm-2.4/include -I/usr/include/atk-1.0 -I/usr/include/glibmm-2.4 -I/usr/lib/i386-linux-gnu/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/i386-linux-gnu/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/i386-linux-gnu/cairomm-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0/

I am not sure what am i missing.

PS: Please provide me your thoughts/suggestions/solutions in simple format as i am new to linux kernel development.
 
Old 09-06-2012, 05:02 AM   #2
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
What does this say?
Code:
pkg-config --list-all | grep gtk
 
1 members found this post helpful.
Old 09-06-2012, 05:16 AM   #3
Sarvendu
LQ Newbie
 
Registered: Aug 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Please find below the result of provided command:

gtk+-2.0 GTK+ - GTK+ Graphical UI Library (x11 target)
gtk+-unix-print-2.0 GTK+ - GTK+ Unix print support
gtk+-x11-2.0 GTK+ - GTK+ Graphical UI Library (x11 target)
gtkmm-2.4 gtkmm - C++ binding for the GTK+ toolkit

Last edited by Sarvendu; 09-06-2012 at 05:17 AM.
 
Old 09-06-2012, 06:21 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
g++ Main.cpp -o main 'pkg-config --libs --cflags gtkmm-2.4' command
Please try :
g++ `pkg-config --cflags --libs gtkmm-2.4` Main.cpp -o main

! Must be back-tics.


.

Last edited by knudfl; 09-06-2012 at 06:26 AM.
 
1 members found this post helpful.
Old 09-06-2012, 06:28 AM   #5
Sarvendu
LQ Newbie
 
Registered: Aug 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
After running the command; following was the response.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgtkmm-2.4-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

Error still persists.
 
Old 09-06-2012, 06:29 AM   #6
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
See Knud's "edited" post!
 
Old 09-06-2012, 06:45 AM   #7
Sarvendu
LQ Newbie
 
Registered: Aug 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Smile

There was an issue in the program. Corrected program as follows:

#include <gtkmm.h>

int main (int argc, char* argv[]){
Gtk::Main kit(argc, argv);

Gtk:: Window window;

Gtk::Main::run(window);

return 0;
}

Also compile with following command as per Knud's post

g++ `pkg-config --cflags --libs gtkmm-2.4` Main.cpp -o main

Received following errors:

/tmp/ccNHlRb6.o: In function `main':
Main.cpp.text+0x28): undefined reference to `Gtk::Main::Main(int&, char**&, bool)'
Main.cpp.text+0x3c): undefined reference to `Gtk::Window::Window(Gtk::WindowType)'
Main.cpp.text+0x48): undefined reference to `Gtk::Main::run(Gtk::Window&)'
/tmp/ccNHlRb6.o: In function `__static_initialization_and_destruction_0(int, int)':
Main.cpp.text+0xc5): undefined reference to `Glib::ustring::ustring(char const*)'
collect2: ld returned 1 exit status
 
  


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
Pkg-config problem at Xorg7.1 libs c31c Linux From Scratch 5 12-25-2010 09:58 AM
Make file error 127 ./config.status: No such file or directory przemekfilu Linux - Newbie 4 11-17-2010 02:06 AM
`pkg-config --cflags --libs glib-2.0" -lpthread Nagababa Linux - Newbie 4 08-03-2010 07:29 AM
DPKG & "files list file for package `pkg-config' contains empty filename" error :( Angelus Debian 2 04-02-2005 07:34 AM
pkg-config error. eye Linux - Software 2 08-29-2003 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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