Hello Everyone
Could you please help me. I'm using mingw 4.8.1 obtained from here:
http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-win32/seh/x64-4.8.1-release-win32-seh-rev3.7z/download
I use mingw to build ninja from source with libcxx from source on Windows 7
64,
ninja is here: https://github.com/martine/ninja
libcxx is here http://llvm.org/svn/llvm-project/libcxx/trunk
I've made some small patches to ninja, like replacing <wchar.h> with
<cwchar> etc.
But when I compile, I get this error (see more of my comments after this):
--------------------------------
c:\ninja>ninja.bootstrap.exe
[9/13/26] CXX build\disk_interface.o
FAILED: clang++ -MMD -MT build\disk_interface.o -MF
build\disk_interface.o.d -nostdinc++ -I/libcxx/include -march=corei7
-std=c++11 -Wall -Wextra -Wno-deprecated -Wno-unused-parameter -fno-rtti
-fno-exceptions -pipe -Wno-missing-field-initializers -DNINJA_
PYTHON="python.exe" -O3 -DNDEBUG -D_WIN32_WINNT=0x0601
-DWIN32_LEAN_AND_MEAN -c src\disk_interface.cc -o build\disk_interface.o
In file included from src\disk_interface.cc:24:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:116:37:
error: call to 'wcschr' is ambiguous
if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
^~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:840:34:
note: candidate function
_CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
^
/libcxx/include\cwchar:180:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
^
In file included from src\disk_interface.cc:24:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:120:37:
error: call to 'wcsrchr' is ambiguous
if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
^~~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:851:34:
note: candidate function
_CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
^
/libcxx/include\cwchar:186:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s,
wchar_t __c) {return ::wcsrchr(__s, __c);}
^
2 errors generated.
[4/13/26] CXX build\build.o
FAILED: clang++ -MMD -MT build\build.o -MF build\build.o.d -nostdinc++
-I/libcxx/include -march=corei7 -std=c++11 -Wall -Wextra -Wno-deprecated
-Wno-unused-parameter -fno-rtti -fno-exceptions -pipe
-Wno-missing-field-initializers -DNINJA_PYTHON="python.exe
" -O3 -DNDEBUG -D_WIN32_WINNT=0x0601 -DWIN32_LEAN_AND_MEAN -c src\build.cc
-o build\build.o
In file included from src\build.cc:33:
In file included from src/subprocess.h:25:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:116:37:
error: call to 'wcschr' is ambiguous
if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
^~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:840:34:
note: candidate function
_CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
^
/libcxx/include\cwchar:180:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
^
In file included from src\build.cc:33:
In file included from src/subprocess.h:25:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:120:37:
error: call to 'wcsrchr' is ambiguous
if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
^~~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:851:34:
note: candidate function
_CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
^
/libcxx/include\cwchar:186:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s,
wchar_t __c) {return ::wcsrchr(__s, __c);}
^
2 errors generated.
[1/13/26] CXX build\line_printer.o
FAILED: clang++ -MMD -MT build\line_printer.o -MF build\line_printer.o.d
-nostdinc++ -I/libcxx/include -march=corei7 -std=c++11 -Wall -Wextra
-Wno-deprecated -Wno-unused-parameter -fno-rtti -fno-exceptions -pipe
-Wno-missing-field-initializers -DNINJA_PYTH
ON="python.exe" -O3 -DNDEBUG -D_WIN32_WINNT=0x0601 -DWIN32_LEAN_AND_MEAN -c
src\line_printer.cc -o build\line_printer.o
In file included from src\line_printer.cc:26:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:116:37:
error: call to 'wcschr' is ambiguous
if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
^~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:840:34:
note: candidate function
_CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
^
/libcxx/include\cwchar:180:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
^
In file included from src\line_printer.cc:26:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:120:37:
error: call to 'wcsrchr' is ambiguous
if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
^~~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:851:34:
note: candidate function
_CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
^
/libcxx/include\cwchar:186:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s,
wchar_t __c) {return ::wcsrchr(__s, __c);}
^
2 errors generated.
[0/13/26] CXX build\graph.o
ninja: build stopped: subcommand failed.
--------------------------------
The problem appears to be in mingw's stralign header.
C:\mingw\x86_64-w64-mingw32\include\stralign.h
If I change line 116 AND line 120 of it to apply ::
i.e. change:
if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
to:
if(WSTR_ALIGNED(String)) return ::wcschr((PCWSTR)String,Character);
and change:
if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
to:
if(WSTR_ALIGNED(String)) return ::wcsrchr((PCWSTR)String,Character);
Then I can build successfully.
Could somebody apply a patch such as above to stralign.h or a better one if
there is one that would fix this problem?
I would like to submit my changes back to ninja, but whilst a problem like
this exists, they're not likely to accept it as the situation would prevent
ninja building correctly.
I build llvm and libcxx and ninja with mingw so I would like these all to
work together smoothly.
Thanks
Glen
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public