LinuxQuestions.org
Visit Jeremy's Blog.
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 06-18-2003, 03:57 AM   #16
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30

Quote:
Originally posted by andox
hi im getting the same problems when i try to compile too.. im also new at linux and im not sure of what to do.. even after i read the above im still a lil ocnfused.. where do i get these packages?
You are confusing us too, be specific. Where is your code, and what did you type in the command line.
 
Old 06-18-2003, 03:58 AM   #17
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
Quote:
Originally posted by eg_wwkaa
-lstdc++ indicate the library name?
Yes, it is refers to the static object library archive: libstdc++.a
 
Old 06-18-2003, 04:29 AM   #18
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
Dear GtkUser,

So, do I need to include anything in compiling command when the program contain Qt library Code?

Anyway, Really thank you very much. You have help me a lot!
 
Old 06-18-2003, 06:45 AM   #19
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
Qt is a C++ widget toolkit, in other words it's a GUI library. You might not have it installed. The other popular C widget toolkit is called Gtk+ and Gtkmm is the Standard C++ bindings. Again, you might not have this installed either. They would both require special commands. Typically these toolkits use a command line utility called pkg-config. This utility takes care of finding the widget set libraries, and the linking process.

If I were compiling my Gtkmm application I would do it like this:
Code:
#include<gtkmm.h>
 
int main( int argc, char *argv[] ) {
  Gtk::Main kit(argc,argv);
  Gtk::Window window;
  Gtk::Main::run(window);
 
  return 0;
}
[prompt]$ g++ base.cpp `pkg-config gtkmm-2.0 --cflags --libs`
[prompt]$ ./a.out

This part of the command " `pkg-config gtkmm-2.0 --cflags --libs` " is the package config utility, the rest of the command is normal g++ (or you could use gcc like demonstrated earlier).

Gtk+ would be compiled simularly however the package would be gtk+-2.0 rather than gtkmm-2.0.

I'm not sure about Qt because I perfer Gtkmm since modern C++ can be used with Gtkmm and not Qt. I can only help if you want to install Gtkmm, but you need Gtk+2.0 installed first. It is probably there already.

Last edited by GtkUser; 06-18-2003 at 06:46 AM.
 
Old 06-18-2003, 10:20 AM   #20
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
I found that the package 'libstdc++-devel' is not installed
It is the reason of why I can't compile the program?
 
Old 06-18-2003, 10:25 AM   #21
jvannucci
Member
 
Registered: Jan 2003
Location: Connecticut, US
Distribution: Red Hat 9.0
Posts: 98

Rep: Reputation: 15
Hmmm, I asked you this in the first reply to this thread, and you said the package was installed. Yes, this could be your problem. While it's instructive for all of us to think through useful answers, please be careful and specific when helping to troubleshoot your own system. We all could have saved a lot of time.
 
Old 06-18-2003, 10:40 AM   #22
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
Also, when I was trying to install libstdc++-devel-3.3-5.i386.rpm, it says there is a dependency with the package 'libstdc++-devel', how Can I deal with this?
 
Old 06-18-2003, 10:44 AM   #23
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
I am really sorry for my stupid.
Actually, when I saw the message about the checking of the package, I am in my office. Thus, I can't check at that time. Also, last night, I have just check the package 'compat-libstdc++-devel', it really exists.
 
Old 06-18-2003, 10:48 AM   #24
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
rpm -ip libstdc++-devel-3.3-5.i386.rpm
error: Failed dependencies:
libstdc++ = 3.3-5 is needed by libstdc++-devel-3.3-5
 
Old 06-18-2003, 10:54 AM   #25
jvannucci
Member
 
Registered: Jan 2003
Location: Connecticut, US
Distribution: Red Hat 9.0
Posts: 98

Rep: Reputation: 15
OK, now you're confusing me. I wanna be careful here. On my RH 9 system:

# rpm -qa | grep stdc++

returns:
libstdc++-devel-3.2.2-5
compat-libstdc++-7.3-2.96.118
libstdc++-3.2.2-5
compat-libstdc++-devel-7.3-2.96.118

Do the same on your system. Do you have all (any) of these installed?

Next, when I check for what dependencies are required for libstdc++-devel-* here's what I get:

# rpm -qR libstdc++-devel
libstdc++ = 3.2.2-5
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1

So it's not dependent on itself (!), but on libstdc++. Back to the first question - do you have this installed?
 
Old 06-18-2003, 10:56 AM   #26
jvannucci
Member
 
Registered: Jan 2003
Location: Connecticut, US
Distribution: Red Hat 9.0
Posts: 98

Rep: Reputation: 15
From wherever you have your rpms, issue:

# rpm -Uvh libstdc++-3.2.2-5*.rpm
# rpm -Uvh libstdc++-devel*.rpm
 
Old 06-18-2003, 10:59 AM   #27
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
# rpm -qa | grep stdc++
compat-libstdc++-devel-7.3-2.96.118
libstdc++-3.2.2-5
compat-libstdc++-7.3-2.96.118

# rpm -qR libstdc++-devel
package libstdc++-devel is not installed

I am downloading 'libstdc++3.2.2-5'
is it ok if I install this package?
 
Old 06-18-2003, 11:01 AM   #28
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
However, when I trying to install the 'libstdc++3.2.2-5'

but it return:

# rpm -pi libstdc++-devel-3.2.2-5.i386.rpm
error: cannot get exclusive lock on /var/lib/rpm/Packages
error: cannot open Packages index using db3 - This operatino is not allowed (1)
error: cannot open Packages database in /var/lib/rpm
 
Old 06-18-2003, 11:05 AM   #29
jvannucci
Member
 
Registered: Jan 2003
Location: Connecticut, US
Distribution: Red Hat 9.0
Posts: 98

Rep: Reputation: 15
Well, 'rpm-qa' seems to say you already have it installed, but perhaps there's something screwed up with it, so yeah, reinstall. Just make sure to use -U (-Uvh), so you update any existing package.

Then rerun the 'rpm-qa'...
 
Old 06-18-2003, 11:06 AM   #30
eg_wwkaa
LQ Newbie
 
Registered: Jun 2003
Posts: 23

Original Poster
Rep: Reputation: 15
It seems a little messy... I am really sorry for wasting your time. But I would be very appreciate for you kindly patients...

The conclusion is, I haven't got the package 'libstdc++-devel-3.2.2-5.i386.rpm' installed. However, when I use the command 'rpm -Uvh libstdc++-devel-3.2.2-5.i386.rpm' to install this package, it said it can't get the exclusive lock.
 
  


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
Compile program ust Linux - General 5 05-31-2004 04:37 PM
How does one compile a program? What do you need? TheMusicGuy Linux - Newbie 4 03-12-2004 01:10 AM
Compile Program mattp Linux - Newbie 4 03-09-2004 11:13 AM
Compile qt program. hfawzy Linux - General 2 02-18-2003 10:25 AM
compile program Eddie9 Linux - General 1 05-21-2002 10:11 PM

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

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