-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: no member named 'max_align_t' in the global namespace #334
Comments
I'm not sure what I changed to fix it, but it is working now. It might have been that I changed clang from 3.4 to 3.5... It's hard to say. If I figure it out, I'll let you all know. |
For the record this is not something I've seen before. In any case it doesn't appear to be really a "Catch" thing - although perhaps something about the way Catch includes std lib headers brought it out? The Glad you got it sorted, though. |
To give (or get) moral support, I'm experiencing similarly unexpected behaviour from clang/libc++ (at Travis). See lest issue #10. |
What is odd is that I figured out a way to get around it... But it's annoying. I'm using cmake and it downloads catch on the fly using ExternalProgram_Add as per the instructions. In any case, I call cmake and then make and it works fine for the initial build. Then, if call I cmake and make again without removing all of the files, it throws that error. So right now, I just |
@DanTheColoradan This isn't a Catch issue - it's a compiler/library mismatch issue. There's no requirement that compiler A be interoperable with compiler B's stdlib implementation, and although the Clang folks certainly go out of their way to ensure their compiler works with gcc's 3.11.2 requires that
That sets CMake's C compiler, not the C++ compiler; you may want to try adding
I've seen cases where setting You may want to consider trying:
|
Thanks! I'll give it a go. And as I mentioned, I'm definitely not claiming it's a catch issue. I mostly wanted to double check it wasn't, and also leave a record for anyone who stumbles upon this problem. I'll give your suggestions a thorough testing and leave it at that :) Thanks again! 👍 |
Thanks Andy (@PureAbstract) - I missed that the compiler and std libs were being mixed up that way. |
@philsquared I think @martinmoene 's actually having a related issue (i.e. travis mixing clang w/libstdc++) - but it can be a bit harder to figure out what's going on with travis :-). |
@DanTheColoradan Hope it was of some help - the CMake FAQ summarises the CMAKE_CXX_COMPILER issue here - http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F |
It was. I was able to get a little further after reading that documentation, but it was still acting funny. So, I've decided against using clang on linux and I'm just going to use gcc for now. I think that's a better choice anyway since I'll be forced to compile with at least two compilers (i.e. clang on my mac and gcc on linux). I really appreciate your help. Edit: by linux I mean Ubuntu ;-) |
to fix this error: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/cstddef:51:11: error: no member named 'max_align_t' in the global namespace using ::max_align_t; related: catchorg/Catch2#334
@DanTheColoradan You are right. Updating to clang 3.6 fixed it. Thanks |
This gives us full C++11 support and avoids a problem with Catch framework (which we're going to use for testing): catchorg/Catch2#334 The recipe was lifted from http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/
I think this has to do with this issue:
clang-3.5: once gcc-4.9 and g++-4.9 are installed, clang stops properly building existing projects
I tried adding
set (CMAKE_C_COMPILER "/usr/bin/clang")
to the catch CMakeLists.txt, but it still output this:I also change my alternatives (Ubuntu) for gcc / g++ to 4.8 so that
gcc --version && g++ --version
both returngcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
andg++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
. But it still pops the error up.Any idea how to get it to use 4.8? Or how I might solve this problem else-how?
Edit:
Btw, I'm sorry if this is the wrong place for this. I thought you guys might have run into this problem already and therefore know a solution. Plus, I want to have this recorded in the issues so if someone else has the same problem, they know how to fix it.
The text was updated successfully, but these errors were encountered: