Why does not Clang recognize the basic header (iostream)?

0

Command line:

clang++ "C:\caminho\completo\helloworld.cpp" -o "C:\caminho\completo\helloworld.exe"

Code:

#include <iostream>
using namespace std;
int main(){
    cout << "Ola Mundo" << endl;
    return 0 ;
}

Error:

C:\caminho\completo\helloworld.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^
1 error generated.

I have already looked at the internet and for the briefest of my understanding I should use libG ++ from minGW, if so, what is the purpose of clang?

    
asked by anonymous 14.03.2017 / 23:33

1 answer

1

As far as I know, Apple created CLANG because the GCC uses the GPL license. Apple needed to implement some language "enhancements" to support its products, and if they implemented those improvements in GCC, they should release the code to the GNU community.

Creating CLANG, they used another type of license, which allowed Apple to have private branches of CLANG and were not required to release the source code.

In your case, if you need to use CLANG, install libstdc ++ will work.

    
15.03.2017 / 02:02