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

Compilation error: expression cannot be used as a function #19

Closed
ShantihBlah opened this issue Aug 27, 2021 · 5 comments
Closed

Compilation error: expression cannot be used as a function #19

ShantihBlah opened this issue Aug 27, 2021 · 5 comments

Comments

@ShantihBlah
Copy link

ShantihBlah commented Aug 27, 2021

Hello! When I compile the raisimOgre by running the last step —— “make install -j8”, I find the following error and fail to compile it:

[ 81%] Building CXX object CMakeFiles/raisimOgre.dir/src/OgreVis.cpp.o
In file included from /home/weilang/raisim_build/include/raisim/math/Core.hpp:13,
                 from /home/weilang/raisim_build/include/raisim/math.hpp:17,
                 from /home/weilang/raisim_build/include/raisim/object/Object.hpp:12,
                 from /home/weilang/raisim_build/include/raisim/World.hpp:13,
                 from /home/weilang/raisim_workspace/raisimOgre/include/raisim/interfaces.hpp:12,
                 from /home/weilang/raisim_workspace/raisimOgre/include/raisim/OgreVis.hpp:29,
                 from /home/weilang/raisim_workspace/raisimOgre/src/OgreVis.cpp:15:
/home/weilang/raisim_build/include/raisim/math/Matrix.hpp: In instantiation of ‘raisim::Mat<n, m>::Mat(const T2&) [with T2 = raisim::Mat<3, 1>*; long unsigned int n = 3; long unsigned int m = 1]’:
/home/weilang/raisim_workspace/raisimOgre/src/OgreVis.cpp:1271:75:   required from here
/home/weilang/raisim_build/include/raisim/math/Matrix.hpp:55:117: error: expression cannot be used as a function
   55 |   Mat(const T2 &rhs) { for (size_t i = 0; i < rows(); ++i) for (size_t j = 0; j < cols(); ++j) operator()(i,j) = rhs(i,j); }
      |                                                                                                                  ~~~^~~~~
make[2]: *** [CMakeFiles/raisimOgre.dir/build.make:154: CMakeFiles/raisimOgre.dir/src/OgreVis.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:207: CMakeFiles/raisimOgre.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

(From 70b753d68145fc2868ab5921a30fced7891dc7f2)

@ShantihBlah ShantihBlah changed the title Compile error: expression cannot be used as a function Compilation error: expression cannot be used as a function Aug 27, 2021
@jhwangbo
Copy link
Contributor

which OS, compiler, CPU did you use?

@ShantihBlah
Copy link
Author

OS: ubuntu20.04;
Compiler: g++9.0;
CPU: 16 (cores) AMD RYZEN 7 4800H.

@jhwangbo
Copy link
Contributor

Did you update both raisimLib and raisimOgre to the latest version?

@ShantihBlah
Copy link
Author

The raisimOgre I used is the latest, but the raisimLib is not. I will update it and try again.

@ShantihBlah
Copy link
Author

It works!
Thank you very much!

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