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

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

Open
AnasCHARROUD opened this issue Feb 19, 2021 · 1 comment

Comments

@AnasCHARROUD
Copy link

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
Copy link

Hi,
you need to change this line:

add_executable(test_ray_tracing cpp/test_ray_tracing.cpp)

to
add_library(test_ray_tracing cpp/test_ray_tracing.cpp)

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