mercredi 28 septembre 2016

C++ program compiles and runs in codeblocks, but can't compile it in terminal

I created a C++ project that contains several source files and header files. The program compiles and runs well in codeblocks, but I can't compile it in terminal.

All the files are in the same folder.

Here are the command I enter:

clang++ -std=c++11 main.cpp file1.cpp file1.h 

It shows:

clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated

And a punch of errors about:

error: use of undeclared identifier 'std' 

In the head file.

Aucun commentaire:

Enregistrer un commentaire