Hi,

On Tue, Apr 29, 2014, G M wrote:
> Hi Everyone
> 
> I can't build the popular build program ninja with clang++ and mingw.
> 
> The reason is demonstrated by this simple program:
> 
> // wcx.cpp
> 
> #include <string>
> using namespace std;
> #include <windows.h>
> int main()
> {
>     wchar_t* p = wcschr(L"hello", L'h');
> }
> 
> Compiling this program with g++ yields the same problem, all the errors are
> below, results from clang++ are included too.
> 
> g++ -std=c++1y -I/libcxx/include -nostdinc++ wcx.cpp
> 
> 
> If ninja didn't put a using namespace std; in it's includes, the problem
> would go away, but it does, and in over a year I've had no luck convincing
> them not to put using namespaces in headers and when I mentioned it a year
> ago here it didn't attract any interest.
> 
> On the ninja maintainers side, it is legal, so why should they change it,
> and who knows what other programs break because it doesn't work.
> 
> So my question is, will mingw be changed to make this program compile by
> default?
> 
> If there is a fix, where (actual link please) can I get it?

First, thanks for the (repeated) report(s) and for the reproducer which
is way nicer than thinking about puting use directives in headers.

I'm not aware of a change regarding this. I don't know if anyone
currently has a satisfactory solution.

LRN's solution seems effective but I'm not used to C++ enough to tell if
it's not a bit heavy (are there other places which need such changes?)
and if there's a better solution. Hopefully we can get the discussion
rolling and reach a good answer.

> I'm using a mingw I got here:
> 
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.0/threads-win32/seh/x86_64-4.9.0-release-win32-seh-rt_v3-rev0.7z/download
> 
> It'd be nice if someone actually tried this. Everything you need is listed
> to reproduce the problem: Binaries, test case, compile command lines.
> ninja source is available too so you can even download that, not that you
> need it, the test case demonstrates the problem.
> 
> Also, regarding my earlier post, could someone tell me explicitly what the
> procedure would be to either get the latest trunk mingw to apply to the
> build linked above if that's what I'm supposed to do, or where a more
> recent version of that is that fixes that problem so I can download that?

If you want latest latest you need to build yourself.
Very recent, there are automated builds but unsurprisingly they can have
issues.
Fairly recent, the toolchain you linked to matches as proven by the
version of GCC which was released only a few days ago. You can expect
recent enough to match the latest mingw-w64 code.

> I find navigating the various personal builds/mingw builds tree very
> confusing.

This is a common complain and unfortunately not very easy to address
considering the number, diversity and history of builds; none of which
we'd like to lose.

> Whatever I download is always "old" whenever I try to discuss anything on
> here. Nobody links to anything concrete in their replies.

The one you linked really shouldn't get you into such situations. There
used to be a lot of large changes but this has since settled down now.

> I'm not an expert in mingw and I always find I'm chasing my tail most of
> the time on this forum to get replies that I can actually do anything with,
> despite attempts from people to help, and that's regardless of however much
> info I provide.
> 
> Hopefully this time will be different.

I hope too. I think part of the reason is that we don't necessarily have
a valid answer.

-- 
Adrien Nader

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to