By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,643 Members | 1,080 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,643 IT Pros & Developers. It's quick & easy.

Running C++ file

ilikesuresh
P: 47
Hi,
I wrote the following c++ program in solaris.
For compilation i use,
g++ dup.cpp
command.But while executing like ./dup or dup ,the error i am getting is
ld.so.1: dup: fatal: libstdc++.so.5: open failed: No such file or directory
Killed

Tell me the reason for this and Is there any other way to execute the cpp program?
clarify me
Jan 21 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 849
The syntax for compilation into an executable is:

Expand|Select|Wrap|Line Numbers
  1. g++ *file*.cpp -o *executable name*
  2.  
The -o flag tells the compiler to make an executable of name following the -o, which can be run with ./ as normal. Compiling without it just checks for syntactical errors without running the linker, as if you had used the -c flag.

There are a number of other flags, some of which are very handy. Use man g++ for more information, or consult Google.
Jan 21 '08 #2

ilikesuresh
P: 47
The syntax for compilation into an executable is:

Expand|Select|Wrap|Line Numbers
  1. g++ *file*.cpp -o *executable name*
  2.  
The -o flag tells the compiler to make an executable of name following the -o, which can be run with ./ as normal. Compiling without it just checks for syntactical errors without running the linker, as if you had used the -c flag.

There are a number of other flags, some of which are very handy. Use man g++ for more information, or consult Google.
Even though i compile the file with the same syntax that specified above will not work.I am getting the same error.
Jan 22 '08 #3

ashitpro
Expert 100+
P: 542
Even though i compile the file with the same syntax that specified above will not work.I am getting the same error.
Check whether "libstdc++.so.5" is present in /usr/lib or /usr/local/lib
If it is not there reinstall g++.
If it is there then check out the permissions.
Jan 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.