LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-29-2012, 02:29 PM   #1
undeadgangster
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Rep: Reputation: Disabled
gtkmm compile error


I've been trying to compile some simple gtkmm code on debian squeeze but every time I compile I get the error message #error "Only <glib.h> can be included directly." can someone offer some assistance

the code I'm trying to compile:

#include <gtkmm.h>

int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}

Last edited by undeadgangster; 07-30-2012 at 09:10 AM.
 
Old 07-29-2012, 03:04 PM   #2
billyoc
LQ Newbie
 
Registered: Oct 2010
Posts: 23

Rep: Reputation: 23
Quote:
Originally Posted by undeadgangster View Post
I've been trying to compile some simple gtkmm code on debian squeeze but every time I compile I get the error message #error "Only <glib.h> can be included directly." can someone offer some assistance

the code I'm trying to compile:

#include <gtkmm.h>

Int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
Return 0;
}
Well, "Int" and "Return" will never compile, they both have to be lower case. After fixing those, your code compiles under gtkmm 2.4 and 3.0. That error is usually seen when trying to include something like "glib/foobar.h", and should definitely not be caused by the above code. Are you sure that's the exact code that's failing?
 
Old 07-30-2012, 09:47 AM   #3
undeadgangster
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by billyoc
Well, "Int" and "Return" will never compile, they both have to be lower case.
After fixing those, your code compiles under gtkmm 2.4 and 3.0. That error is
usually seen when trying to include something like "glib/foobar.h", and should
definitely not be caused by the above code. Are you sure that's the exact code
that's failing?
"Int" and "Return" were errors I made when putting the code here but other than that this is the exact code I'm try to compile and that's failing.

Last edited by undeadgangster; 07-30-2012 at 09:48 AM.
 
  


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
The error compile C/C++ in linux (but it does compile on Win) hikaru1505 Programming 2 12-30-2010 09:11 AM
error when install gtkmm-2.12.7 n0dame Slackware 8 02-21-2009 06:50 AM
gtkmm app compilation error PatrickNew Programming 0 12-07-2007 02:27 PM
Did you get gtkmm's hello world tutorial to compile/link? I'm having trouble Dezzroy Programming 8 09-26-2007 09:10 AM
gtkmm configuration error Sulman Shah SUSE / openSUSE 4 10-31-2006 06:08 AM

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

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