vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

errors when compiling asymptote-2.86 #385

Closed grozin closed 12 months ago

grozin commented 12 months ago

Linux, gcc-13.1.1. I get zillion errors

x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -D_FILE_OFFSET_BIS=64 -DUSEGC   -DFFTWPP_SINGLE_THREAD -Wall -DHAVE_SYS_TYPES_H -I. -I/usr/incl
ude/gc -I/usr/include/gc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600   -I/usr/include/eigen3  -I/usr/include/tirpc   -O2 -march=native -pipe 
-O2 -march=native -pipe -fno-var-tracking -ILspCpp/include -o psfile.o -c psfile.cc
In file included from errormsg.h:15,
                 from vm.h:11,
                 from camperror.cc:15:
symbolmaps.h: In constructor ‘AsymptoteLsp::SymbolInfo::SymbolInfo()’:
symbolmaps.h:137:25: error: ‘nullopt’ was not declared in this scope; did you mean ‘std::nullopt’?
  137 |     SymbolInfo() : type(nullopt), pos(1, 1) {}
      |                         ^~~~~~~
      |                         std::nullopt
In file included from LspCpp/include/LibLsp/JsonRpc/optionalVersion.h:9,
                 from LspCpp/include/LibLsp/JsonRpc/serializer.h:14,
                 from LspCpp/include/LibLsp/lsp/lsPosition.h:3,
                 from symbolmaps.h:11:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/optional:89:30: note: ‘std::nullopt’ declared here
   89 |   inline constexpr nullopt_t nullopt { nullopt_t::_Construct::_Token };
      |                              ^~~~~~~
symbolmaps.h: In constructor ‘AsymptoteLsp::SymbolInfo::SymbolInfo(std::string, AsymptoteLsp::posInFile)’:
symbolmaps.h:140:37: error: ‘nullopt’ was not declared in this scope; did you mean ‘std::nullopt’?
  140 |       name(std::move(inName)), type(nullopt), pos(std::move(position)) {}
      |                                     ^~~~~~~
      |                                     std::nullopt
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/optional:89:30: note: ‘std::nullopt’ declared here
   89 |   inline constexpr nullopt_t nullopt { nullopt_t::_Construct::_Token };
      |                              ^~~~~~~
symbolmaps.h: In constructor ‘AsymptoteLsp::FunctionInfo::FunctionInfo(std::string, AsymptoteLsp::posInFile, std::string)’:
symbolmaps.h:180:35: error: ‘nullopt’ was not declared in this scope; did you mean ‘std::nullopt’?
  180 |             arguments(), restArgs(nullopt) {}
      |                                   ^~~~~~~
      |                                   std::nullopt

and so on. All of them are about symbolmaps.h: nullopt was not declared in this scope. By the way, asymptote-2.85 compiles fine. What has changed in symbolmaps.h recently? Any ideas how to proceed?

johncbowman commented 12 months ago

Can you try the latest git code? We will make a new release soon. Probably this was fixed in commit 29caaed5ead5a62787475286afd22e40585b8bb8 Author: John Bowman bowman@ualberta.ca Date: Wed Jun 14 22:36:35 2023 -0600

Fix --without-lsp (issue #379).
grozin commented 12 months ago

With the patch 29caaed it compiles. And successfully generates its documentation (and this is a good self-test).