error: "__GXX_EXPERIMENTAL_CXX0X__" is not defined [-Werror=undef]

299 views
Skip to first unread message

dev123

unread,
Jan 9, 2014, 9:33:36 AM1/9/14
to googletes...@googlegroups.com
I have build (./confgure && make) gtest 1.7 on:

Linux ubuntu 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

and:

gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1

but when I build my tests I get:


g++ -o build/64gccdbg/jpp/testing/jpptest.o -c -pthread -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -D_MULTI_THREADED -Wall -Wextra -Wconversion -Wsign-promo -Wmissing-include-dirs -Wnon-virtual-dtor -Wfloat-equal -Wcast-qual -Wwrite-strings -Wredundant-decls -Wpointer-arith -Wno-unknown-pragmas -Wabi -Wctor-dtor-privacy -Wreorder -Wshadow -Wold-style-cast -Wstrict-null-sentinel -Wuninitialized -Winit-self -Wunused -Wundef -Wempty-body -Wcast-align -Wlogical-op -Winvalid-pch -Wsync-nand -Wpacked -Wpacked-bitfield-compat -Wvla -Woverlength-strings -Wmissing-declarations -Werror -O0 -ggdb -DCS_WSF_DEBUG_RESOURCES -D_DEBUG -Icpp/3rdparty/gtest-1.7.0/include -Icpp/3rdparty/gmock-1.7.0/include -Icpp cpp/jpp/testing/jpptest.cpp
In file included from cpp/3rdparty/gtest-1.7.0/include/gtest/internal/gtest-internal.h:40:0,
                 from cpp/3rdparty/gtest-1.7.0/include/gtest/gtest.h:58,
                 from cpp/jpp/testing/jpptest.cpp:3:
cpp/3rdparty/gtest-1.7.0/include/gtest/internal/gtest-port.h:277:6: error: "__GXX_EXPERIMENTAL_CXX0X__" is not defined [-Werror=undef]
 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
      ^
cpp/3rdparty/gtest-1.7.0/include/gtest/internal/gtest-port.h:288:6: error: "GTEST_OS_WINDOWS" is not defined [-Werror=undef]
 #if !GTEST_OS_WINDOWS


I have found this:

which seems related but it does not really provide a solution. I have not found anything here:


either.

Billy Donahue

unread,
Jan 9, 2014, 12:15:45 PM1/9/14
to dev123, Google C++ Testing Framework
Thanks for the report.

It's specified behavior for the preprocessor that X expands to 0 if X is not defined, so gtest is actually not invalid here, but it's understandable to consider supporting all the strict flags people want to use, especially in test builds.

Your immediate needs can be met by removing -Wundef while we work on it.




--
 
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

dev123

unread,
Jan 10, 2014, 5:11:44 AM1/10/14
to googletes...@googlegroups.com, dev123


On Thursday, January 9, 2014 6:15:45 PM UTC+1, Billy Donahue wrote:
Thanks for the report.

It's specified behavior for the preprocessor that X expands to 0 if X is not defined, so gtest is actually not invalid here, but it's understandable to consider supporting all the strict flags people want to use, especially in test builds.

Your immediate needs can be met by removing -Wundef while we work on it.



 FYI the build also fails when throwing errors on the following warnings:

-Wctor-dtor-privacy
-Wabi

/gtest-1.7.0/include/gtest/internal/gtest-internal.h:779:7: error: all member functions in class ‘testing::internal::ImplicitlyConvertible<From, To>’ are private [-Werror=ctor-dtor-privacy]
 class ImplicitlyConvertible {
       ^
In file included from cpp/3rdparty/gtest-1.7.0/include/gtest/internal/gtest-param-util.h:47:0,
                 from cpp/3rdparty/gtest-1.7.0/include/gtest/gtest-param-test.h:192,
                 from cpp/3rdparty/gtest-1.7.0/include/gtest/gtest.h:62,
                 from cpp/javascript/testing/javascripttest.cpp:3:
cpp/3rdparty/gtest-1.7.0/include/gtest/gtest-printers.h:497:13: error: the mangled name of ‘void testing::internal::PrintTo(const std::tr1::tuple<>&, std::ostream*)’ will change in a future version of GCC [-Werror=abi]

Reply all
Reply to author
Forward
0 new messages