Miscellaneous > Programming & Networking
basic C++ question
slvadcjelli42:
OK, I've discovered more and also kicked myself for not noticing the thread below mine with the EXACT (well, pretty close) same problem as me. I'll move into that.
MikeU:
You should use g++ rather than gcc to compile C++ code. I believe g++ will be installed if gcc is installed.
g++ source.cpp
SAJChurchey:
actually, with newer versions of C++, you have to use the namespace feature of C++ like this.
--- Code: ---
--- End code ---
It should work fine after u add that namespace and use g++.
Study up on namespaces.
Maniaman:
I had the same problem.
--- Code: ---
--- End code ---
That fixed it for me, should work for you.
slvadcjelli42:
lol thanks for your help, although it's been pretty much fixed (in that other thread)... using namepace std made no difference either way, it turns out, g++ / c++ would compile it and gcc would not. Thanks anyway though, and I will still read up on namespaces.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version