LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-21-2005, 09:39 AM   #1
dr_berta
LQ Newbie
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 12.04 64bit; Slackware 13 64bit; Gentoo
Posts: 14

Rep: Reputation: 0
C++ application with Glade: compiling problem


I'm starting to write a C++ interface application using Glade as generator. I'm using a Slackware 10.1 distribution with kernel 2.4.29 and glade 2.6.0. To be able to obtain C++ code I've installed the following libraries:
gtkmm-2.4.8
glibmm-2.4.8
libsigc++-2.0.9
libglademm-2.4.2
Now Glade generates my C++ code and the autogen.sh script to create the Makefile.
The problem is that when I try to compile the code using "make", I have this error:

make all-recursive
make[1]: Entering directory `/root/Project/3kvp'
Making all in src
make[2]: Entering directory `/root/Project/3kvp/src'
make[2]: *** No rule to make target `3kvp.c', needed by `3kvp.o'. Stop.
make[2]: Leaving directory `/root/Project/3kvp/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Project/3kvp'
make: *** [all] Error 2

It seems that the complier is tryng to compile a .c file but my source file is a .cc file.

How can I solve this problem?

Thank's
dr_berta
 
Old 09-22-2005, 06:26 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
You can go it the Makefile and change the filename in there. but you also better make sure its using g++ and not gcc to compile.
 
Old 09-26-2005, 09:39 AM   #3
dr_berta
LQ Newbie
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 12.04 64bit; Slackware 13 64bit; Gentoo
Posts: 14

Original Poster
Rep: Reputation: 0
Thank you Leonscape.
I've followed your suggestion and I'm sure I use g++, but now I have a problem with library path.
When I try to compile the error message is:

make all-recursive
make[1]: Entering directory `/root/Project/3kvp'
Making all in src
make[2]: Entering directory `/root/Project/3kvp/src'
g++ -g -O2 -c -o 3kvp.o 3kvp.cc
3kvp.cc:8:20: config.h: No such file or directory
3kvp.cc:9:24: gtkmm/main.h: No such file or directory
In file included from Window1.hh:13,
from 3kvp.cc:11:
Window1_glade.hh:21:30: gtkmm/accelgroup.h: No such file or directory
In file included from Window1.hh:13,
from 3kvp.cc:11:
Window1_glade.hh:26: error: syntax error before `::' token
Window1_glade.hh:29: error: parse error before `::' token
Window1_glade.hh:31: error: missing ';' before right brace
Window1_glade.hh:33: error: ISO C++ forbids defining types within return type
Window1_glade.hh:33: error: syntax error before `::' token
Window1_glade.hh:39:26: gtkmm/window.h: No such file or directory
Window1_glade.hh:40:29: gtkmm/separator.h: No such file or directory
Window1_glade.hh:41:25: gtkmm/label.h: No such file or directory
Window1_glade.hh:42:28: gtkmm/textview.h: No such file or directory
Window1_glade.hh:43:25: gtkmm/ruler.h: No such file or directory
Window1_glade.hh:44:31: gtkmm/progressbar.h: No such file or directory
Window1_glade.hh:45:31: gtkmm/drawingarea.h: No such file or directory
Window1_glade.hh:46:31: gtkmm/radiobutton.h: No such file or directory
Window1_glade.hh:47:32: gtkmm/togglebutton.h: No such file or directory
Window1_glade.hh:48:26: gtkmm/button.h: No such file or directory
Window1_glade.hh:49:25: gtkmm/fixed.h: No such file or directory
Window1_glade.hh:51: error: `Gtk' is not a class or namespace
Window1_glade.hh:52: error: `Window' is not a class or namespace
Window1_glade.hh:52: error: invalid base-class specification
Window1_glade.hh:56: error: invalid use of `::'
Window1_glade.hh:56: error: parse error before `*' token
Window1_glade.hh:57: error: no type named `HSeparator' in `struct Gtk'
Window1_glade.hh:58: error: no type named `Label' in `struct Gtk'
Window1_glade.hh:59: error: no type named `TextView' in `struct Gtk'
Window1_glade.hh:60: error: no type named `TextView' in `struct Gtk'
Window1_glade.hh:61: error: no type named `Label' in `struct Gtk'
Window1_glade.hh:62: error: no type named `Label' in `struct Gtk'
Window1_glade.hh:63: error: no type named `TextView' in `struct Gtk'
Window1_glade.hh:64: error: no type named `VSeparator' in `struct Gtk'
Window1_glade.hh:65: error: no type named `TextView' in `struct Gtk'
Window1_glade.hh:66: error: no type named `HRuler' in `struct Gtk'
Window1_glade.hh:67: error: no type named `VRuler' in `struct Gtk'
Window1_glade.hh:68: error: no type named `ProgressBar' in `struct Gtk'
Window1_glade.hh:69: error: no type named `DrawingArea' in `struct Gtk'
Window1_glade.hh:70: error: no type named `TextView' in `struct Gtk'
Window1_glade.hh:71: error: no type named `Label' in `struct Gtk'
Window1_glade.hh:72: error: no type named `Label' in `struct Gtk'
Window1_glade.hh:73: error: no type named `Label' in `struct Gtk'
Window1_glade.hh:74: error: no type named `RadioButton' in `struct Gtk'
Window1_glade.hh:75: error: no type named `RadioButton' in `struct Gtk'
Window1_glade.hh:76: error: no type named `ToggleButton' in `struct Gtk'
Window1_glade.hh:77: error: no type named `Button' in `struct Gtk'
Window1_glade.hh:78: error: no type named `Button' in `struct Gtk'
Window1_glade.hh:79: error: no type named `ToggleButton' in `struct Gtk'
Window1_glade.hh:80: error: no type named `Button' in `struct Gtk'
Window1_glade.hh:81: error: no type named `Fixed' in `struct Gtk'
3kvp.cc: In function `int main(int, char**)':
3kvp.cc:16: error: incomplete type `Gtk' does not have member `Main'
3kvp.cc:16: error: parse error before `(' token
3kvp.cc:19: error: `m' undeclared (first use this function)
3kvp.cc:19: error: (Each undeclared identifier is reported only once for each
function it appears in.)
make[2]: *** [3kvp.o] Error 1
make[2]: Leaving directory `/root/Project/3kvp/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Project/3kvp'
make: *** [all] Error 2

I installed libraries in /usr/local using make and make install commands. Then I copied .pc files from usr/local/lib/pkgconfig to /usr/lib/pkgconfig
Is this the problem? What I have to do to correct this error?
 
Old 09-26-2005, 01:36 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
It appears that the program hasn't configured properly as you have got

3kvp.cc:8:20: config.h: No such file or directory
3kvp.cc:9:24: gtkmm/main.h: No such file or directory

I( suggest you do a reconfigure and check the paths, you may have to set the prefix, and possibly other paths, do a

./configure --help

and check what options you can set, simply moving the files arounf is generally a bad idea.
 
Old 09-27-2005, 01:56 AM   #5
dr_berta
LQ Newbie
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 12.04 64bit; Slackware 13 64bit; Gentoo
Posts: 14

Original Poster
Rep: Reputation: 0
OK! I'm trying to do that and I will eliminate the copy of .pc files that I putted in /usr/lib/pkgconfig.

But what I don't understand is why I don't have /usr/local in my library path.
It seems that libraries are correctly installed in /usr/local (default option), but each library search other ones in /usr only and not also in /usr/local.

How can I check if my library path is correct?

Thank's
 
Old 09-27-2005, 03:50 AM   #6
dr_berta
LQ Newbie
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 12.04 64bit; Slackware 13 64bit; Gentoo
Posts: 14

Original Poster
Rep: Reputation: 0
I've uninstalled libraries and I've reconfigured them using ./configure with --prefix=/usr option.
Then I've recompiled and reinstalled them.
Everything was OK about libsigc++, glibmm and gtkmm, but during the reconfiguration process of the glademm library, I had this warning message:
...
checking installed gtk1 version (not needed)... 1.2.10
checking installed gtk2 version... 2.6.1
checking installed gtk-- version (not needed)... ./configure: line 20135: gtkmm-config: command not found
configure: WARNING: Can't determine your gtkmm version, assuming
1.0.0
checking installed gtkmm-2 version (not needed)... 2.4.8
checking for gnome-- 1.x version (not needed)... ./configure: line 20290: gnome-config: command not found
gnome-config not found
Package libgnomemm-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgnomemm-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgnomemm-2.0' found
Package libgnomeuimm-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgnomeuimm-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgnomeuimm-2.0' found
Package libbonobomm-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libbonobomm-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libbonobomm-2.0' found
Package libbonobouimm-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libbonobouimm-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libbonobouimm-2.0' found
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/writers/Makefile
config.status: creating tests/Makefile
config.status: creating docs/Makefile
config.status: creating docs/old/Makefile
config.status: creating src/SourceWriter/Makefile
config.status: creating glademm.spec
config.status: creating config.h
config.status: executing depfiles commands

I know that I don't have installed libgnomemm and libbonobomm libraries (if necessary I will do it), but I dont know if this warning message is important or not using glademm.
Can I compile and install the library without problems?
 
Old 09-29-2005, 04:37 PM   #7
dr_berta
LQ Newbie
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 12.04 64bit; Slackware 13 64bit; Gentoo
Posts: 14

Original Poster
Rep: Reputation: 0
Thank's leonscape, I solved my problem.
I compiled the library glademm without considering the warning, then I compiled my software.
I also found that the automatic generation of the makefile doesn't add the command 'pkg-config gtkmm-2.0 --cflags -- libs'.
Adding this to the g++ command the compiler work fine.
I would like to modify the automatic generation of the makefile but I don't know where and what I have to modify.
Any suggestion for me?

Thank's
 
Old 09-29-2005, 07:23 PM   #8
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
Sorry not really, I'm a KDE developer, So I don't have much to do with the gtkmm, glade and the rest.

Glad you got it working.
 
Old 09-30-2005, 01:43 AM   #9
mythagel
LQ Newbie
 
Registered: Jul 2003
Location: Melbourne
Distribution: Ubuntu Breezy
Posts: 9

Rep: Reputation: 0
libglademm

Glade code generation is depreciated in favour of loading the glade file at runtime.
This also works out to be a lot easier!

There is some documentation on how to load the glade file and access the widgets at
http://www.gtkmm.org/gtkmm2/docs/tut...html/ch19.html
 
Old 09-30-2005, 02:38 AM   #10
dr_berta
LQ Newbie
 
Registered: Sep 2005
Location: Carpi (Modena) - Italy
Distribution: Ubuntu 12.04 64bit; Slackware 13 64bit; Gentoo
Posts: 14

Original Poster
Rep: Reputation: 0
My original idea was to develop my application using QT libraries and Kdevelop, but when I try to edit C++ code I have this message:

There is no plugin for editing C++ code installed!
Note: plugins are not available in static Qt configurations

Now I will proceed using gtk, but, for the future, if I will have to develop C++ applications with Qt, where I could find the required plugin?

Thank you mythagel, I will read it.
 
Old 10-03-2005, 07:09 PM   #11
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
I assume its where you got the rest of KDE, check the source where you got the slack packages, or you could try this.
 
  


Reply


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
[gtk] - adding an application icon using glade Misel Programming 3 01-08-2011 11:35 AM
GLADE compiling problem shegay18 Programming 3 07-03-2005 10:15 AM
glade problem AbhishekSamuel Linux - Software 0 05-05-2005 04:35 AM
glade problem ??? Morpheus Linux - Software 0 03-04-2003 09:25 PM
Application Compiling Daxziz Linux - General 3 02-20-2002 03:21 AM


All times are GMT -5. The time now is 06:50 AM.

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