Closed whyman closed 2 years ago
Build / Build (ubuntu-16.04) - Debug (pull_request) Build / Build (ubuntu-16.04) - Release (pull_request)
/home/runner/work/pupnp/pupnp/upnp/src/api/UpnpLog.cpp: In constructor ‘UpnpLog::UpnpLog()’:
/home/runner/work/pupnp/pupnp/upnp/src/api/UpnpLog.cpp:20:11: error: ‘nullptr’ was not declared in this scope
, m_logFp(nullptr)
^
/home/runner/work/pupnp/pupnp/upnp/src/api/UpnpLog.cpp: In member function ‘int UpnpLog::InitLog()’:
/home/runner/work/pupnp/pupnp/upnp/src/api/UpnpLog.cpp:131:26: error: ‘nullptr’ was not declared in this scope
setLogFp(nullptr);
^
/home/runner/work/pupnp/pupnp/upnp/src/api/UpnpLog.cpp: In member function ‘void UpnpLog::Printf(Upnp_LogLevel, Dbg_Module, const char*, int, const char*, __va_list_tag*)’:
/home/runner/work/pupnp/pupnp/upnp/src/api/UpnpLog.cpp:183:34: error: ‘nullptr’ was not declared in this scope
size = vsnprintf(nullptr, 0, fmtStr, sizeCopy) + 1;
^
make[2]: *** [upnp/CMakeFiles/upnp_static.dir/src/api/UpnpLog.cpp.o] Error 1
upnp/CMakeFiles/upnp_static.dir/build.make:187: recipe for target 'upnp/CMakeFiles/upnp_static.dir/src/api/UpnpLog.cpp.o' failed
CMakeFiles/Makefile2:403: recipe for target 'upnp/CMakeFiles/upnp_static.dir/all' failed
make[1]: *** [upnp/CMakeFiles/upnp_static.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
Which version of C++ is project using? nullptr
is available from C++11.
Ubuntu 16.04 build is cmake based. Could it be that its default compiler option is not -std=c++11? Maybe we should include a line in the scripts to print the options beeing used, compiler version, etc.
If C++11 is needed, we can tell cmake to check and take care of that. I just need to know what to turn off or on when found or not.
C++11 is a more than resonable requirement. I would put this always on.
Commit added to require C++11
You did it 40 minutes before I arrived home.
va_list cannot be used multiple times and causes a crash