Why doesn’t Clang recognize the basic header (iostream)?

Asked

Viewed 145 times

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 taken a look through the internet and for the brief that I understood it should use the libc++ of mingw, if so, what purpose to exist the Clang ?

1 answer

1


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

Creating CLANG, they used another license type, which allowed Apple to have private CLANG branchs and not be required to release the source codes.

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

  • Apple is a great user and contributor to the Clang, but I don’t think Apple "created the Clang"

  • "Apple chose to develop a new Piler front end from Cratch, supporting C, Objective-C and C++. [11] This "Clang" project was open-sourced in July 2007. [13]" (https://en.wikipedia.org/wiki/Clang) This may be q wikipedia is wrong...

  • using this Log is very complicated, I was able to compile but only with mingw installed and path. There is no c++ compiler that works in this world

  • It exists and is called GCC brotha. Vc is developing in C++ on Windows and using open source compilers (pq a Visual Studio license costs a note). The problem is not the compiler. Install Eclipse CDT, configure your.

  • Although a professional Visual Studio license is expensive, only companies with more than 250 computers or an annual redemption of more than $1 million need it. I believe that both are not the case of the user who asked the question. I would recommend to any Windows user the use of Visual Studio Community for development. In my opinion, its use and its configuration process are much more friendly for those who are accustomed to using Windows.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.