1

Sorry, but where can I find mingw32 with the same directories structure as Clang assumes ?

I downloaded 32bit version from here http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/

Also another one from here http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/32-bit/threads-posix/dwarf/

but all of the not the same as what clang searches for when I run :

clang++ -v main.cpp
the resut:
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.0/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.0/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.0/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.1/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.1/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.1/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.2/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.2/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.2/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.3/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.3/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.3/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.0/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.0/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.0/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.1/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.1/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.1/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.2/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.2/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.8.2/include/c++/backw
ard"
ignoring nonexistent directory "/usr/include/c++/4.4"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "C:\LLVM\bin\..\lib\clang\3.6.0\../../../i686-w64
-mingw32/include"
ignoring nonexistent directory "C:\LLVM\bin\..\lib\clang\3.6.0\../../../x86_64-w
64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "c:/mingw/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include  search starts here:
 C:\LLVM\bin\..\lib\clang\3.6.0\include
 C:\LLVM\bin\..\lib\clang\3.6.0\../../../include
End of search list.
main.cpp:1:10: fatal error: 'iostream' file not found
#include 
Ahmed T. Ali
  • 1,021
  • 1
  • 13
  • 22
  • This article works for me :) [Installing Clang 3.5 for Windows](https://yongweiwu.wordpress.com/2014/12/24/installing-clang-3-5-for-windows/) Regards. – Ahmed T. Ali Feb 28 '15 at 09:09

2 Answers2

2

Have you tried use mingw-get installation tools to install corresponding compiler and headers? In my knowledge, mingw provide GNU tools in Windows command lines and Cygwin provide them in a *nix like command lines (usually bash). Apparently your error is due to clang can not find headers so I wonder if you have them installed correctly or not :)

Bob
  • 34
  • 5
  • BTW, Cygwin will provide a *nix like file structure too. – Bob Feb 28 '15 at 08:14
  • 1
    No, I just download .7z from the links above . but why it's differ ? they are work if I compile any *.c or *.cpp files . but the problem with Clang assumptions – Ahmed T. Ali Feb 28 '15 at 08:17
  • @Noobs Then you can try to copy mingw's C++ headers to your LLVM include dir. – Bob Feb 28 '15 at 08:23
  • 1
    I tried :) , but then it became a link error same as this http://stackoverflow.com/questions/28758917/clang-clang-dont-find-c-c-headers-in-windows – Ahmed T. Ali Feb 28 '15 at 08:29
0

Let me counter your question with another: why on earth would you want such a beast? See, in general it is a very bad idea to mix system components from disparate compiler tool chains. If you want to use clang, then use clang system components, and keep MinGW system components well out of its way; conversely, if you want to use MinGW, use its system components, and keep clang's out of its way.

By all means install both, but keep them both physically and logically separated; never attempt to use system components belonging to one in conjunction with the other. If you adhere to this dictum, then the file system structure for MinGW will be correct for MinGW, and that for clang will be correct for clang; you have no need to concern yourself that they may differ, one from the other.

Keith Marshall
  • 1,980
  • 15
  • 19
  • As an aside, please note that neither of the links mentioned in the original question refers to a product which is officially a MinGW compiler tool chain, (in the sense that they are distributed, maintained, and supported by MinGW.org. If your pseudo-MinGW tool chain is incomplete, (as seems to be the case), then it is likely that you have failed to install it correctly. If you use MinGW.org's officially supported mingw-get installation tool, then you will get an officially supported installation, for which mingw-get's dependency resolution should ensure completeness, and correctness. – Keith Marshall Mar 09 '15 at 07:51
  • 1
    Keith, the answer to your question is simply: Because CLang requires it. Currently, you can build a perfectly working LLVM/Clang for Windows, but _with the exception_ that it doesn't have a C++ standard library. I have once or twice managed to build libc++ without errors from SVN trunk (currently it doesn't seem to work?), but when you attempt to use it, then it will choke on basic components such as `` not being present. On the other hand, installing Clang directly into an existing MinGW (...-w64) installation works perfectly well in every respect. – Damon Mar 09 '15 at 09:19
  • The "CLang installer for Windows" is similar, except it borrows standard library and headers from MSVC rather than MinGW. – Damon Mar 09 '15 at 09:20
  • @Damon: if CLang requires MinGW's c++ components, then the onus is on CLang to work with the file system structure which MinGW provides, **not**, as the original question implies, the other way around. The original question should thus have been "how do I make CLang work with the directory structure which MinGW provides?", (which is the standard structure specified by the GCC build process, BTW). The answer to the question, as asked, is "nowhere, because MinGW works with the directory layout as specified for GCC, and has no need to pander to the quirks of any other compiler tool chain". – Keith Marshall Mar 09 '15 at 23:04
  • That's right, but making Clang obey a different dir structure is nasty WTF!! stuff involving hand-editing paths in source files whereas finding a MinGW-alike that has a compatible layout (e.g. all -w64 and -TDM) is easy. I haven't used the vanilla MinGW that you maintain in about 2-3 years, so I couldn't tell if the real MinGW would work too (given proper Clang config). Anyway, building a _working, no trouble_ compiler from SVN is, much much much surprisingly, really a matter of _"set sysroot and prefix, run cmake, build, go"_ now with Clang, which cannot be said about GCC (total nightmare). – Damon Mar 10 '15 at 09:34