This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: About Linking of a simple C++ prog.


brook_wc wrote:

>   I just installed gcc2.95 on Solaris 8 sparc.
>   I also installed the binutils too.
>   But when compiling the Hello program, I met the error 
> message as followes:
>   $PWD$gcc test.cpp

You need to compile and link using the C++ compiler driver, g++:

    fox:~$ cat test.cpp
    #include <iostream.h>
    main()
    {
       cout<<"hello"<<endl;
    }
    fox:~$ g++ test.cpp
    fox:~$ ./a.out
    hello
    fox:~$ uname -a
    SunOS fox 5.8 Generic_108528-06 sun4u sparc SUNW,Sun-Blade-100

Rup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]