certik / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Build Failure on CentOS 5 #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
CentOS 5, 64 bit
2.6.18-348.18.1.el5 #1 SMP Thu Sep 26 15:01:07 EDT 2013 x86_64 x86_64 x86_64 
GNU/Linux

boost-1.33.1-16.el5_9
boost-devel-1.33.1-16.el5_9
boost-doc-1.33.1-16.el5_9

tar zxvf yaml-cpp-0.5.1.tar.gz 
cd yaml-cpp-0.5.1
cmake -G 'Unix Makefiles'

make
Scanning dependencies of target yaml-cpp
...
/root/Downloads/yaml-cpp-0.5.1/include/yaml-cpp/contrib/graphbuilder.h:20: 
warning: ‘class YAML::GraphBuilderInterface’ has virtual functions but 
non-virtual destructor
[ 74%] Building CXX object 
CMakeFiles/yaml-cpp.dir/src/contrib/graphbuilder.cpp.o
/root/Downloads/yaml-cpp-0.5.1/include/yaml-cpp/contrib/graphbuilder.h:20: 
warning: ‘class YAML::GraphBuilderInterface’ has virtual functions but 
non-virtual destructor
Linking CXX static library libyaml-cpp.a
[ 74%] Built target yaml-cpp
Scanning dependencies of target run-tests
[ 76%] Building CXX object test/CMakeFiles/run-tests.dir/spectests.cpp.o
[ 79%] Building CXX object test/CMakeFiles/run-tests.dir/main.cpp.o
[ 82%] Building CXX object test/CMakeFiles/run-tests.dir/tests.cpp.o
[ 84%] Building CXX object test/CMakeFiles/run-tests.dir/emittertests.cpp.o
[ 87%] Building CXX object test/CMakeFiles/run-tests.dir/new-api/spectests.cpp.o
[ 89%] Building CXX object 
test/CMakeFiles/run-tests.dir/new-api/parsertests.cpp.o
[ 92%] Building CXX object test/CMakeFiles/run-tests.dir/new-api/nodetests.cpp.o
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:3:29: error: 
boost/foreach.hpp: No such file or directory
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp: In function 
‘<unnamed>::TEST Test::Node::ForEach()’:
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:391: error: expected 
primary-expression before ‘const’
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:391: error: 
‘BOOST_FOREACH’ was not declared in this scope
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:391: error: expected 
`;' before ‘{’ token
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:389: warning: unused 
variable ‘seq’
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:390: warning: unused 
variable ‘i’
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:576: error: expected 
`}' at end of input
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp: At global scope:
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:576: error: expected 
`}' at end of input
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:576: error: expected 
`}' at end of input
make[2]: *** [test/CMakeFiles/run-tests.dir/new-api/nodetests.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/run-tests.dir/all] Error 2

Original issue reported on code.google.com by d_e_wh...@icloud.com on 12 Oct 2013 at 6:25

GoogleCodeExporter commented 9 years ago
Got one step further:
foreach.hpp is located in /usr/include/boost/test/utils/foreach.hpp

Modified test/new-api/nodetests.cpp
changed #include <boost/foreach.hpp> to #include <boost/test/utils/foreach.hpp>

make clean
make
...
/root/Downloads/yaml-cpp-0.5.1/include/yaml-cpp/contrib/graphbuilder.h:20: 
warning: ‘class YAML::GraphBuilderInterface’ has virtual functions but 
non-virtual destructor
[ 74%] Building CXX object 
CMakeFiles/yaml-cpp.dir/src/contrib/graphbuilder.cpp.o
/root/Downloads/yaml-cpp-0.5.1/include/yaml-cpp/contrib/graphbuilder.h:20: 
warning: ‘class YAML::GraphBuilderInterface’ has virtual functions but 
non-virtual destructor
Linking CXX static library libyaml-cpp.a
[ 74%] Built target yaml-cpp
[ 76%] Building CXX object test/CMakeFiles/run-tests.dir/spectests.cpp.o
[ 79%] Building CXX object test/CMakeFiles/run-tests.dir/main.cpp.o
[ 82%] Building CXX object test/CMakeFiles/run-tests.dir/tests.cpp.o
[ 84%] Building CXX object test/CMakeFiles/run-tests.dir/emittertests.cpp.o
[ 87%] Building CXX object test/CMakeFiles/run-tests.dir/new-api/spectests.cpp.o
[ 89%] Building CXX object 
test/CMakeFiles/run-tests.dir/new-api/parsertests.cpp.o
[ 92%] Building CXX object test/CMakeFiles/run-tests.dir/new-api/nodetests.cpp.o
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp: In function 
‘<unnamed>::TEST Test::Node::ForEach()’:
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:391: error: expected 
primary-expression before ‘const’
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:391: error: 
‘BOOST_FOREACH’ was not declared in this scope
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:391: error: expected 
`;' before ‘{’ token
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:389: warning: unused 
variable ‘seq’
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:390: warning: unused 
variable ‘i’
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:576: error: expected 
`}' at end of input
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp: At global scope:
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:576: error: expected 
`}' at end of input
/root/Downloads/yaml-cpp-0.5.1/test/new-api/nodetests.cpp:576: error: expected 
`}' at end of input
make[2]: *** [test/CMakeFiles/run-tests.dir/new-api/nodetests.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/run-tests.dir/all] Error 2
make: *** [all] Error 2

Original comment by d_e_wh...@icloud.com on 12 Oct 2013 at 6:29

GoogleCodeExporter commented 9 years ago
It looks like Boost.Foreach was first introduced in 1.34:

http://www.boost.org/doc/libs/1_33_0
http://www.boost.org/doc/libs/1_34_0

Original comment by jbe...@gmail.com on 13 Oct 2013 at 4:07

GoogleCodeExporter commented 9 years ago
I added an #ifdef check to eliminate those tests when using an old version of 
Boost.

Fixed, rb0dceee936db.

Original comment by jbe...@gmail.com on 13 Oct 2013 at 4:15