Google Test 1.6.0 release candidate: compilation failed with Sun C++ 5.11 SunOS_i386

51 views
Skip to first unread message

Alfred Gebert

unread,
Mar 1, 2011, 3:27:54 AM3/1/11
to googletes...@googlegroups.com
gtest 1.6.0 does not compile with Sun Compiler on Solaris x86. With
1.5.0 I had compile errors too. As workaround I still use gtest 1.4.

Alfred

-bash-3.00$ CC -V
CC: Sun C++ 5.11 SunOS_i386 2010/08/13
-bash-3.00$ cmake ../gtest-1.6.0
-- The CXX compiler identification is SunPro
-- The C compiler identification is SunPro
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found PythonInterp: /usr/bin/python2.4
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for thr_create in thread
-- Looking for thr_create in thread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/agebert/src/gtest-1.6.0-build-release
-bash-3.00$ make
Scanning dependencies of target gtest
[ 50%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.o
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-printers.h", line
741: Error: static
testing::internal::TuplePrefixPrinter<1>::PrintPrefixTo<testing::internal::TuplePrefixPrinter<1>::Tuple>(const
testing::internal::TuplePrefixPrinter<1>::Tuple&, std::ostream *)
already had a body defined.
"/home/agebert/src/gtest-1.6.0/include/gtest/internal/gtest-param-util-generated.h",
line 61: Error: iterator_traits is not a member of std.
"/home/agebert/src/gtest-1.6.0/include/gtest/internal/gtest-param-util-generated.h",
line 61: Error: "," expected instead of "<".
"/home/agebert/src/gtest-1.6.0/include/gtest/internal/gtest-param-util-generated.h",
line 61: Error: Illegal value for template parameter.
"/home/agebert/src/gtest-1.6.0/include/gtest/internal/gtest-param-util-generated.h",
line 61: Error: value_type is not a member of
testing::internal::ParamGenerator<int>.
"/home/agebert/src/gtest-1.6.0/include/gtest/internal/gtest-param-util-generated.h",
line 61: Error: A declaration does not specify a tag or an identifier.
"/home/agebert/src/gtest-1.6.0/include/gtest/internal/gtest-param-util-generated.h",
line 61: Error: Templates can only declare classes or functions.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
309: Error: iterator_traits is not a member of std.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
309: Error: "," expected instead of "<".
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
309: Error: Illegal value for template parameter.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
309: Error: value_type is not a member of
testing::internal::ParamGenerator<int>.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
309: Error: A declaration does not specify a tag or an identifier.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
309: Error: Templates can only declare classes or functions.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
314: Error: A declaration was expected instead of "return".
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
314: Error: ParamType is not defined.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
315: Error: No direct declarator preceding "(".
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
319: Error: internal is not defined.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
319: Error: ParamGenerator is not defined.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
319: Error: A declaration does not specify a tag or an identifier.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
319: Error: Templates can only declare classes or functions.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
321: Error: A declaration was expected instead of "}".
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
324: Error: internal is not defined.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
324: Error: ParamGenerator is not defined.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
324: Error: A declaration does not specify a tag or an identifier.
"/home/agebert/src/gtest-1.6.0/include/gtest/gtest-param-test.h", line
324: Error: Templates can only declare classes or functions.
Compilation aborted, too many Error messages.
*** Error code 2
The following command caused the error:
/usr/bin/CC -I/home/agebert/src/gtest-1.6.0/include
-I/home/agebert/src/gtest-1.6.0 -DGTEST_HAS_PTHREAD=1
-features=except -o CMakeFiles/gtest.dir/src/gtest-all.cc.o -c
/home/agebert/src/gtest-1.6.0/src/gtest-all.cc
make: Fatal error: Command failed for target
`CMakeFiles/gtest.dir/src/gtest-all.cc.o'
Current working directory /home/agebert/src/gtest-1.6.0-build-release
*** Error code 1
The following command caused the error:
make -f CMakeFiles/gtest.dir/build.make CMakeFiles/gtest.dir/build
make: Fatal error: Command failed for target `CMakeFiles/gtest.dir/all'
Current working directory /home/agebert/src/gtest-1.6.0-build-release
*** Error code 1
The following command caused the error:
make -f CMakeFiles/Makefile2 all
make: Fatal error: Command failed for target `all'

Alfred Gebert

unread,
Mar 1, 2011, 4:19:56 AM3/1/11
to googletes...@googlegroups.com
On Tue, Mar 1, 2011 at 9:27 AM, Alfred Gebert <alfred...@gmail.com> wrote:
> gtest 1.6.0 does not compile with Sun Compiler on Solaris x86. With
> 1.5.0 I had compile errors too. As workaround I still use gtest 1.4.
>

With compile option -library=stlport4 and a patch from Hady Zalek it
compiles now.

Reply all
Reply to author
Forward
0 new messages