LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-02-2006, 10:26 AM   #1
Tux-O-Matic
Member
 
Registered: Sep 2006
Distribution: Fedora Core 5 (no internet)
Posts: 95

Rep: Reputation: 15
No libraries, no packages...


I tried to write a C++ program recently, but when I tried to compile it, the error message gave me an error telling me I didn't have the cstdio library. When I looked for it, I found it in, I think, the /usr/share/ directory (called gcc32).

I have a similar problem in Java with TerminalIO and other packages. I can't seem to make a reference to the packages.

I would really like some help. Now it seems like Perl is the only language that works the way I want it to.
 
Old 11-02-2006, 12:09 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 30
what commands are you using to build the C++ and java projects ?
(more information the better)
 
Old 11-02-2006, 02:09 PM   #3
Tux-O-Matic
Member
 
Registered: Sep 2006
Distribution: Fedora Core 5 (no internet)
Posts: 95

Original Poster
Rep: Reputation: 15
I type the following:
Quote:
gcc foo.cpp
Where foo is the name of the file.
I got a long, complicated string that basically said it couldn't find the libraries.
When that didn't work, I tried the other method:
Quote:
chmod 777 foo.cpp
./foo.cpp
Then, I recieved more of a specific error message, saying it couldn't find the libraries.

Java generally did the same thing.
Quote:
javac foo.java
java foo
Please note, that with Java, I was able to get an output, and even though I have the packages for input (TerminalIO), I could not get the compiler to recognize TerminalIO or any other package.
 
Old 11-03-2006, 08:36 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Is your environment set up correctly?
ie for dynamic libraries, you'll want to have $LD_LIBRARY_PATH set correctly.

And please post:
1. your c++/java code;
2. the exact error messages

EDIT: for Java, you may need $CLASSPATH and/or $JAVA_HOME for instance.
 
Old 11-27-2006, 04:13 PM   #5
Tux-O-Matic
Member
 
Registered: Sep 2006
Distribution: Fedora Core 5 (no internet)
Posts: 95

Original Poster
Rep: Reputation: 15
Sorry it took so long to get back...
Here's the C++ Code:
Quote:
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace;
int main (int nNumberOfArgs, char* pszArgs[])
{
cout << "Hello World!\n";
system ("PAUSE");
return 0;
}
Here's what I typed:
Quote:
gcc HelloWorld.cpp
Oops...I don't know what happed to the file with the debuggin info. It basically said cstdio and iostream couldn't be found, and also that using wasn't a valid command.
 
Old 11-28-2006, 01:36 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
1. Try compiling it with g++ instead of gcc. This shouldn't make much difference, but try it anyway.
2. If you want to use the default "std" namespace, you should omit the "using namespace;" line or put
"using namespace std".
3. Clearly, your compiler can't locate your C++ libraries. Can you please post the output of
echo $LD_LIBRARY_PATH
echo $PATH
whereis libstdc++
 
  


Reply

Tags
c++, java, libraries, packages


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to save a list of installed packages and install these packages later mandavi Ubuntu 5 09-07-2009 11:36 AM
Linkage Error with Libraries coming as Debian packages stackoverflow32 Linux - Software 0 08-05-2004 04:16 PM
orphan packages and libraries alexrait1 Slackware 1 07-05-2004 06:18 PM
libraries, packages, file locations janve Slackware 4 11-29-2003 10:34 PM
creating packages (.tgz/.deb/.rpm) How from the source packages? l_9_l Linux - General 1 03-06-2002 06:03 PM


All times are GMT -5. The time now is 03:43 PM.

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