Originally Posted by
toontastic
Thank you both very much for your help. Seems it was further back when I used it than my brain cells first thought. That has worked perfectly for me thanks.
As for the stdafix.h, I found it in a C++ ebook I was reading and it was suggested as part of the test code for Hello World so I wasn't sure if it was something I was missing. Needless to say I have not stuck with that book.
Actually I was wrong, that hasn't worked either. Still getting an error about cout. If I try to build the code I get.
Code:
**** Build of configuration Debug for project Hello ****
make all
Building file: ../hello.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"hello.d" -MT"hello.d" -o "hello.o" "../hello.cpp"
../hello.cpp: In function ‘int main()’:
../hello.cpp:6:2: error: ‘cout’ was not declared in this scope
../hello.cpp:6:2: note: suggested alternative:
In file included from ../hello.cpp:1:0:
/usr/include/c++/4.7/iostream:62:18: note: ‘std::cout’
What I now have written is
Code:
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;
}
Bookmarks