tomlau10 / gcc-make-run

Compile-run C/C++ source code and execute Makefile in Atom.
https://atom.io/packages/gcc-make-run
MIT License
24 stars 10 forks source link

C++ compiler not compiling iostream #21

Closed PedroSilva8 closed 6 years ago

PedroSilva8 commented 7 years ago

For some reason when using gcc-make-run to compile c++ it doesn't compile #include <iostream> but when compiling the same code manually with mingw

tomlau10 commented 7 years ago

this plugin used editor's grammar to detect which compiler (gcc or g++) to use seems that atom treated your file as a c file then it used the gcc compiler and cause errors like undefined reference tostd::ios_base::Init::~Init()`


  1. you need to change the editor's grammar (default hotkey ctrl + shift + L) to c++
  2. or add a library flag -lstdc++ in build option so you can still use gcc compiler
PedroSilva8 commented 7 years ago

@tomlau10 it isn't giving me any error like this undefined reference tostd::ios_base::Init::~Init() and grammar is treated like c++

tomlau10 commented 7 years ago

can you screen capture and paste the error && file content here? 🤔