c++ - Fatal error: 'stdafx.h' file not found -
i new programming c++ , trying learn myself through websites (learncpp.com) although stuck on compiling first program =( . use visual studio program code , because using macbook, use vi , terminal (or should use else?)
here's helloworld.cpp program wrote based on tutorial:
#include "stdafx.h" #include <iostream> { std::cout <<"hello world!" <<std::end1; return 0; } when compiled (gcc -wall hello.cpp) error :
helloworld.cpp:1:10: fatal error: 'stdafx.h' file not found #include "stdafx.h" ^ 1 error generated. can give me insight on how fix this?
stdafx.hprecompiled header used visual studio, not need this.- you seem have missed out
int main()function - it
std::endlnotstd::end1
so this:
#include <iostream> int main() { std::cout <<"hello world!" <<std::endl; return 0; }
Comments
Post a Comment