Below is information about the code, the error produced, and my system.
- Code: Select all
#include <Poco/Util/Units.h>
#include <iostream>
int main(int argc, char *argv[])
{
using namespace Poco::Util::Units::Values;
std::cout << "One mile is " << km(mile(1)) << std::endl;
// Output: One mile is 1.60934 km
return 0;
}
Build Error
- Code: Select all
In file included from ../src/main.cpp:1:0:
../include/Poco/Util/Units.h:331:25: error: expected identifier before ‘static_assert’
../include/Poco/Util/Units.h:331:25: error: expected unqualified-id before ‘static_assert’
,,/include/Poco/Util/Units.h:332:21: error: expected identifier before ‘static_assert’
../include/Poco/Util/Units.h:332:21: error: expected unqualified-id before ‘static_assert’
../include/Poco/Util/Units.h:377:16: error: expected ‘(’ before ‘<’ token
../include/Poco/Util/Units.h:377:16: error: expected primary-expression before ‘<’ token
../include/Poco/Util/Units.h:377:44: error: ‘checkConvertible’ was not declared in this scope
../include/Poco/Util/Units.h:377:60: error: expected ‘,’ before ‘;’ token
../include/Poco/Util/Units.h:377:60: error: expected string-literal before ‘;’ token
../include/Poco/Util/Units.h:377:60: error: expected ‘)’ before ‘;’ token
make[2]: *** [CMakeFiles/brokenunits.dir/main.o] Error 1
make[1]: *** [CMakeFiles/brokenunits.dir/all] Error 2
make: *** [all] Error 2
Poco Version
- Code: Select all
$ cat poco-1.4.3-all/VERSION
1.4.3-all (2012-01-15)
GCC Version
- Code: Select all
$ g++ --version
g++ (GCC) 4.6.1
Linux version (Scientific Linux)
- Code: Select all
$ uname -sori
Linux 2.6.32.59 x86_64 GNU/Linux





