Skip to content

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

@ryandesign

Description

@ryandesign

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions