pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.04k stars 2.11k forks source link

can't compile with poco 1.13 #4584

Closed novazur972 closed 2 weeks ago

novazur972 commented 2 weeks ago

Hi,

I'm not a developer. Under gentoo, I used to compile https://github.com/codayblue/libmyemail with the different versions of poco from version 1.9.0-r2 to version 1.12.4. But since the last update to version 1.13.3, the compilation fails with the error:

/usr/local/src/libmyemail/build # LANG=C make
[50%] Building CXX object CMakeFiles/myemail.dir/myemail.cc.o
In file included from /usr/include/Poco/Net/Net.h:23,
 from /usr/include/Poco/Net/NetSSL.h:23,
 from /usr/include/Poco/Net/SecureSMTPClientSession.h:21,
 from /usr/local/src/libmyemail/source/myemail.cc:23:
/usr/include/Poco/Foundation.h:98:22: error: 'literals' is not a namespace-name
 98 | using namespace std::literals;
 | ^~~~~~~~
make[2]: *** [CMakeFiles/myemail.dir/build.make:76: CMakeFiles/myemail.dir/myemail.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/myemail.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Do you have an idea for adapting myemail in order to continue compiling with this version please?

andrewauclair commented 2 weeks ago

Poco 1.13 requires a minimum version of C++17. The std::literals namespace is available starting in C++14. Looks like that library you're using compiles with C++11, which won't have this feature.

novazur972 commented 2 weeks ago

Seems just replacing 11 by 14 in set(CMAKE_CXX_STANDARD 11) from source/CMakeLists.txt is sufficient.