nx-libs icon indicating copy to clipboard operation
nx-libs copied to clipboard

../version:1:1: error: expected unqualified-id

Open ryandesign opened this issue 1 year ago • 7 comments

Building nxcomp 3.5.99.22 on a case-insensitive filesystem (e.g. on macOS) with a C++20-capable compiler (e.g. Apple clang version 14.0.0 (clang-1400.0.29.202)) fails:

In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/c++/v1/ostream:142:
../version:1:1: error: expected unqualified-id
3.5.99.22
^

This is because C++20 has a header called version which other system headers include, and on a case-insensitive filesystem your VERSION file will be found instead.

Solutions include:

  • Stop adding the -I flag that points to the directory where the VERSION file is located. With a project like this one that uses autoconf, this -I flag is added automatically because this is the directory where config.h is created. So one solution is to move config.h to a different directory.
  • Move the VERSION file to a different directory, one for which an -I flag is not added, and update all references to it, e.g. in version.sh.
  • Rename the VERSION file to something else, e.g. VERSION.txt, and update all references to it.

ryandesign avatar Dec 13 '24 19:12 ryandesign