dilevin / computer-graphics-ray-casting

Computer Graphics Assignment about Ray Casting
2 stars 7 forks source link

macOS, complex not found #57

Open Jaywantstocode opened 1 year ago

Jaywantstocode commented 1 year ago

hi, I was trying to run my make file, but it seems like a complex file is missing from Eigen.

jay@mac build-release % make            
[ 11%] Building CXX object CMakeFiles/raycasting.dir/src/Plane.cpp.o
In file included from .../computer-graphics-ray-casting/src/Plane.cpp:1:
In file included from .../computer-graphics-ray-casting/include/Plane.h:4:
In file included from .../computer-graphics-ray-casting/include/Object.h:4:
.../computer-graphics-ray-casting/eigen/Eigen/Core:28:10: fatal error: 'complex' file not found
#include <complex>
         ^~~~~~~~~
1 error generated.

Did i install it wrong? I did recursively clone the git, and cmake was successful too. Thanks!

panuelosj commented 1 year ago

complex is a std c library. Could you try replacing the lines CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") with CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") in CMakeLists.txt

Jaywantstocode commented 1 year ago

hi, I tried doing this for the 3rd assignment and it worked. thanks!

JG-e commented 2 months ago

Hello, in 2024, I am also encountering this issue... I tried the CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") but it doesn't work for me