[SCALUG] Re: c++ question

Andrea 'fwyzard' Bocci fwyzard@inwind.it
Fri Dec 27 08:06:00 GMT 2002


At 11.18 26/12/2002 +0600, John Burski wrote:

>My thanks to those who responded to my question -- I really appreciate the 
>help.
>
>However, my problem still remains.
>
>
>// cut here - hello.cc
>
>#include <iostream>
>using namespace std;
>
>int main()
>{
>    cout << "Hello, World\n";
>}
>// cut here -eof

// cut here - hello.cc
hello: hello.o
         g++ hello.o -o hello

hello.o: hello.cc
         g++ hello.cc -c -o hello.o

// cut here -eof

At the prompt:
$ make
g++ hello.cc -c -o hello.o
g++ hello.o -o hello

$ ./hello
Hello, World

So, it worke quite well for me.
I think explicitly adding libgcc on the command line (which incidentally is 
a  Bad Thing TM) screws up the librari dependancies.
Don't do it.
The same hold true for adding /usr/include/g++-3 to you include search 
path. There's no need for it, it's done automatically and permanently by 
the "make install" part of the GCC installation.

HTH,
fwyzard 




More information about the Gcc-help mailing list