Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help me compile C++ source with gcc on solaris7/sparc

2 views
Skip to first unread message

Hee-dong Chae

unread,
Sep 13, 2002, 10:19:45 PM9/13/02
to
Hello.
I installed gcc-3.2 binary downloaded from www.sunfreeware.com.
(Because I failed to build source code by myself...)
It compiles C/C++ code very well and the executable from C code runs very
well.
But when I run the excutable compiled from #include <iostream.h> main()
{cout<<"Hello world!"<<endl;} C++ code, I can't see "Hello world!" but the
following frustrating error message.

[hcsun01:/user8/sexyguy/temp 20 ] cpptest
ld.so.1: cpptest: fatal: libstdc++.so.5: open failed: No such file or
directory
Killed

Reading the Host/Target specific installation notes for
GCC(http://gcc.gnu.org/install/specific.html#sparc-sun-solaris2.7), it is
suggested to patch 106950-03. So I patched with 196950-18 (I found that
patch here http://sunsolve.sun.com/pub-cgi/retrieve.pl) which seems to be
latest patch in 106950 series. But only the same thing to happen.
Please help me see "Hello world!" with my C++ program.
I will be looking forward to hear from world-wide experts.


joe durusau

unread,
Sep 14, 2002, 11:07:04 AM9/14/02
to

Hee-dong Chae wrote:

I can think of two possibilities:

1). Maybe you failed to download and install libstdc++. It was in a separate
package, not with the compiler. You could use find to see it it is really
on your system.

2). Maybe the linker is not looking in the right place. If you find the lib,
try using -R<whereitis> in the compiler command line and see if that helps.

Speaking only for myself,

Joe Durusau

Bob R

unread,
Sep 16, 2002, 2:12:37 PM9/16/02
to

I'm just a C++ rookie, but...
For Standard C++ use:

#include <iostream> // <iostream.h> is C header, AFAIK.
// using namespace std;

int main() {
std::cout << "Hello world!" << std::endl;
// cout << "Hello world!" << endl;
return 0;
}

Compile with 'g++ <blah-blah>', (not 'gcc').

If that doesn't work (and what Joe said), then you may have an install
problem.
Be sure the libraries/binaries match the GCC/G++ versions.
news://gnu.g++.help for more help with C++.
--
Bob R
POVrookie
--
MinGW (GNU compiler): http://www.mingw.com/
Dev-C++ IDE: http://www.bloodshed.net/
V IDE & V GUI: http://www.objectcentral.com/
POVray: http://www.povray.org/
alt.comp.lang.learn.c-c++: ftp://snurse-l.org/pub/acllc-c++/faq


0 new messages