I'm experiencing very wierd error when trying to build my program with Boost thread.hpp included (ver. 1.54, but tried also lower):
/home/seweryn/boost/include/boost/functional/hash/detail/float_functions.hpp:78: error: expected nested-name-specifier before 'float'
/home/seweryn/boost/include/boost/functional/hash/detail/float_functions.hpp:78: error: two or more data types in declaration of 'parameter'
/home/seweryn/boost/include/boost/functional/hash/detail/float_functions.hpp:86: error: expected nested-name-specifier before 'float'
/home/seweryn/boost/include/boost/functional/hash/detail/float_functions.hpp:86: error: two or more data types in declaration of 'parameter'
/home/seweryn/boost/include/boost/functional/hash/detail/float_functions.hpp:94: error: expected nested-name-specifier before 'float'
/home/seweryn/boost/include/boost/functional/hash/detail/float_functions.hpp:94: error: two or more data types in declaration of 'parameter'
The float_functions.hpp (fragment):
76. namespace boost {
77. namespace hash_detail {
78. template <typename Float>
79. struct call_ldexp {
80. typedef Float float_type;
81. inline Float operator()(Float x, int y) const {
82. return std::ldexp(x, y);
83. }
84. };
85.
86. template <typename Float>
87. struct call_frexp {
88. typedef Float float_type;
89. inline Float operator()(Float x, int* y) const {
90. return std::frexp(x, y);
91. }
92. };
93.
94. template <typename Float>
95. struct select_hash_type
96. {
97. typedef Float type;
98. };
99. }
100.}
The build command is:
g++ -I/usr/include -I/home/seweryn/boost/include -I/home/seweryn/include -I/home/seweryn/libmpeg7.2/src -O0 -g3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"src/TestApp.d" -MT"src/TestApp.d" -o "src/TestApp.o" "../src/TestApp.cpp"
It looks like the Float
type is recognized as standard float
and it causes the error.
I'm quite unexperienced to C++ so any help is appreciated.
Thanks
UPDATE: It may be important, that this app worked on previous environment (Ubuntu). After moving it to the new one (CentOS) and installing Boost, it fails.