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]
Other format: [Raw text]

Re: [SCALUG] Re: c++ question


Hoopla!!

Thanks for your help! I can see that I've been away from my roots for too long :(

Incidentally, just for kicks I changed the "using namespace std;" phrase to "using std::cout;" and it worked well, too.

Thanks again!

Andrea 'fwyzard' Bocci wrote:

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

.

--
John Burski

@HOME S.I.M.U. (Well, sometimes I am :)  )

... and still searching for the cheese!




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