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?

  1. stdafx.h precompiled header used visual studio, not need this.
  2. you seem have missed out int main() function
  3. it std::endl not std::end1

so this:

#include <iostream> int main() {      std::cout <<"hello world!" <<std::endl;      return 0; } 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -