Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: the value of ‘NrDims’ is not usable in a constant expression #1

Open
ZaynabEM opened this issue Mar 22, 2024 · 2 comments
Open

Comments

@ZaynabEM
Copy link

Greeting,

I was building the code and got the following error :

error: the value of ‘NrDims’ is not usable in a constant expression

I checked the build dependencies and they match the requirements.

  • cmake version 3.22.1
  • GNU Make 4.3
  • gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  • g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  • libpcl-dev is already the newest version (1.12.1+dfsg-3build1).

There are a series of errors, here is the last one :

/usr/include/pcl-1.12/pcl/point_representation.h:310:7:   required from here
/usr/include/pcl-1.12/pcl/point_representation.h:254:48: error: the value of ‘NrDims’ is not usable in a constant expression
/usr/include/pcl-1.12/pcl/point_representation.h:253:19: note: ‘NrDims’ was not initialized with a constant expression
  253 |         const int NrDims = pcl::traits::datatype<PointDefault, Key>::size;
      |                   ^~~~~~
/usr/include/pcl-1.12/pcl/point_representation.h:254:48: note: in template argument for type ‘int’
  254 |         Helper<Key, FieldT, NrDims>::copyPoint (p1_, p2_, f_idx_);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/environment.dir/build.make:76: CMakeFiles/environment.dir/src/environment.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/environment.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Any idea on how to fix this ?

@thebirdgr
Copy link

Same I have this issue too. Installing inside docker.

@thebirdgr
Copy link

Okay found the fix from: XidianLemon/calibration_camera_lidar#28

Upgrade to C17++.

add_definitions(-std=c++11) change to add_definitions(-std=c++17)

In CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants