--std=c++11 fails on master

Scott Kostyshak skostysh at lyx.org
Mon Oct 26 03:27:31 UTC 2020


On Sun, Oct 25, 2020 at 11:23:47PM +0100, Kornel Benko wrote:
> Am Mon, 26 Oct 2020 01:02:38 +0200
> schrieb Yuriy Skalko <yuriy.skalko at gmail.com>:
> 
> > >> On Sun, Oct 25, 2020 at 08:49:05AM +0100, Jean-Marc Lasgouttes wrote:  
> > >> > Le 25 octobre 2020 07:15:17 GMT+01:00, Scott Kostyshak <skost... at lyx.org> a 
> > >> > écrit :  
> > >> > >Do we require c++14 now? If I force --std=c++11 I get errors.  
> > >> > 
> > >> > 
> > >> > It is supposed to work with c++11. What are the errors?  
> > >> 
> > >> [ 25%] Building CXX object 
> > >> src/support/CMakeFiles/support.dir/FileMonitor.cpp.o
> > >> cd /home/scott/lyxbuilds/temp/CMakeBuild/src/support && /usr/bin/c++  
> > >> -DBOOST_USER_CONFIG="<config.h>" -DHUNSPELL_STATIC -DQT_CORE_LIB -DQT_GUI_LIB 
> > >> -I/home/scott/lyxbuilds/temp/CMakeBuild -I/home/scott/lyxbuilds/temp/repo/src 
> > >> -I/usr/include/enchant 
> > >> -I/home/scott/lyxbuilds/temp/repo/3rdparty/hunspell/1.7.0/src/hunspell 
> > >> -I/home/scott/lyxbuilds/temp/repo/3rdparty/hunspell/1.7.0/src 
> > >> -I/home/scott/lyxbuilds/temp/repo/3rdparty/boost 
> > >> -I/home/scott/lyxbuilds/temp/repo/src/support 
> > >> -I/home/scott/lyxbuilds/temp/CMakeBuild/src/support -isystem 
> > >> /usr/include/x86_64-linux-gnu/qt5 -isystem 
> > >> /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem 
> > >> /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem 
> > >> /usr/include/x86_64-linux-gnu/qt5/QtGui  -Wall -Wunused-parameter  
> > >> -DENABLE_ASSERTIONS=1 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 
> > >> -fno-strict-aliasing  -O0 -g3 -D_DEBUG   -fPIC -std=c++11 -o 
> > >> CMakeFiles/support.dir/FileMonitor.cpp.o -c 
> > >> /home/scott/lyxbuilds/temp/repo/src/support/FileMonitor.cpp
> > >> In file included from 
> > >> /home/scott/lyxbuilds/temp/repo/src/support/FileMonitor.cpp:19:
> > >> /home/scott/lyxbuilds/temp/repo/src/support/unique_ptr.h:24:28: error: 
> > >> ???std::make_unique??? has not been declared
> > >>    24 | namespace lyx { using std::make_unique; }  
> > > 
> > > 
> > > Sounds like missing include due to the recent headers cleanup.. P  
> > 
> > I think this error has different cause.
> > 
> > Looking into support/unique_ptr.h:
> > 
> > .......
> > 
> > #ifdef HAVE_DEF_MAKE_UNIQUE
> > 
> > namespace lyx { using std::make_unique; }
> > 
> > #else
> > 
> > .......
> > 
> > This conditional compilation branch should be compiled only for active 
> > HAVE_DEF_MAKE_UNIQUE that should be correctly set by build system since 
> > `std::make_unique` appeared only in C++14.
> > 
> > Scott, could you check this value in your config.h when compiling in 
> > C++11 mode? it should be inactive.
> > 
> > Yuriy
> 
> Should be in build-dir/config.h. But for this, you may need to remove CMakeCache.txt
> first.

I have the following:

#define HAVE_DEF_MAKE_UNIQUE 1

Here is the diff I am using to force C++11:

diff --git a/development/cmake/modules/FindCXX11Compiler.cmake b/development/cmake/modules/FindCXX11Compiler.cmake
index f9a1aaf045..b990191424 100644
--- a/development/cmake/modules/FindCXX11Compiler.cmake
+++ b/development/cmake/modules/FindCXX11Compiler.cmake
@@ -57,8 +57,6 @@ else()
 # Detection of c++20 works well, but our code is not ready for it yet.
 # We currently get errors with internal boost and also from our code.
 #        "--std=c++20"
-        "--std=c++17"
-        "--std=c++14"
         "--std=c++11"
         "--std=gnu++11"
         "--std=gnu++0x"

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20201025/ab4133ed/attachment.asc>


More information about the lyx-devel mailing list