junfenglx / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Does googletest support C++0x/11? #422

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Does googletest support C++0x/11?
If not so, do you intend to support it later?

Using this library with -std=C++11 (-std=C++0x) for gcc is not possible due to 
a list of errors. I did not check it on VC++.

As far as using syntax sugar of new standards is very attractive, I think, it 
is good idea to support them.

Compliling several different binaries with different flags is not an option for 
it is not "easy to use". 

Thanks

Original issue reported on code.google.com by dmit...@interlink-ua.com on 23 Oct 2012 at 9:44

GoogleCodeExporter commented 9 years ago
I too have struggled with this spending many hours trying to figure out why the 
errors manifest when trying to either compile or link gtest with my simple 
project which use the more current g++ 4.7.2 compiler and using the -std=c++11 
option either on my source files and/or gtest. 

I am attempting to use MinGW because I can easily find the current g++ compiler 
there but of course my research indicates that MinGW is poorly supported; 
double trouble for users like me I suppose but it would be nice to have help in 
getting this issue to work. 

Original comment by kst...@gmail.com on 31 Oct 2012 at 3:51

GoogleCodeExporter commented 9 years ago
I am not sure if this is contributing to the problem. Just wanted to say that I 
am able to use gmock/gtest fine with current g++ 4.7.2 on MinGW, only I use 
-std=gnu+11 instead of -std=c++11. I've compiled gtest/gmock as well as my 
sources with -DGTEST_USE_OWN_TR1_TUPLE=0 and -DGTEST_HAS_PTHREAD=0.

I was able to use some of the c++11 extensions such as decltype, auto, rvalue 
references etc, just so if anyone wondering if I really am using c++11 syntax.

There are however issues one such is Issue 424 that prevents me from using DUMA 
for  memory leak detection. 

Original comment by aravind....@gmail.com on 14 Dec 2012 at 10:24

GoogleCodeExporter commented 9 years ago
successfully compiled gmock (gtest included) on osx 10.8.4 with cmake!
CMAKE_CXX_FLAGS = -DGTEST_USE_OWN_TR1_TUPLE=1 -DGTEST_HAS_TR1_TUPLE=1 
-std=c++11 -stdlib=libc++ -Wno-narrowing 
CMAKE_***_LINKER_FLAGS = -stdlib=libc++
The test targets failed to compile: gmock_build_tests, gtest_build_tests, but 
turning them off results successfull build. Currently I use this gmock lib, no 
problems so far.

Original comment by tigyi.ar...@gmail.com on 11 Sep 2013 at 8:32

GoogleCodeExporter commented 9 years ago
compiler: clang

Original comment by tigyi.ar...@gmail.com on 11 Sep 2013 at 8:35

GoogleCodeExporter commented 9 years ago
I tried to compile gtest with Cygwin using c++11 or c++03 but I had errors in 
both. gnu++11/gnu++03 seems to be working but not compatible with my project. 
Why we can't build it with standard flags?

Original comment by com...@gmail.com on 11 Nov 2014 at 2:45

GoogleCodeExporter commented 9 years ago
Is there any news on this? I failed find any knowledge regarding std flags.

Original comment by com...@gmail.com on 3 Mar 2015 at 2:09