acschaefer / ray_tracing

Fast grid-based ray tracing in C++ and Python
MIT License
7 stars 1 forks source link

Scrt1.o: In function `_start': (.text+0x20): undefined reference to `main' #3

Open AnasCHARROUD opened 3 years ago

AnasCHARROUD commented 3 years ago

I have followed all the steps citing in the description (installing catch2, pybind11 work fin!!) but I have got this issue when I've tried to execute the command make -j8 after generating the makefile so I have got this problem . CMake generated by UNIX makefile

[ 50%] Built target ray_tracing_python
[ 75%] Linking CXX executable test_ray_tracing
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
CMakeFiles/test_ray_tracing.dir/build.make:84: recipe for target 'test_ray_tracing' failed
make[2]: *** [test_ray_tracing] Error 1
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/test_ray_tracing.dir/all' failed
make[1]: *** [CMakeFiles/test_ray_tracing.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
ibrahimhroob commented 2 years ago

Hi, you need to change this line: https://github.com/acschaefer/ray_tracing/blob/e32da7eecc918e2239b3765cf7f573ca56d38788/CMakeLists.txt#L15

to add_library(test_ray_tracing cpp/test_ray_tracing.cpp)