DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.54k stars 223 forks source link

Linking with Cmake produces undefined references #59

Closed Flibio closed 6 years ago

Flibio commented 6 years ago

Hello, I am trying to add react physics to my project; however, I cannot get it to properly function. I am using Cmake to build my project, here is my CMakeLists.txt. I am on Windows 10 using the MinGW compiler with the CLion IDE. All I have done is include the reactphysics3d.h file in main.cpp.

As soon as I include the react physics headers, I cannot compile my program because of undefined references.

The build log containing the error messages

What can I do to resolve this issue?

Thank you.

DanielChappuis commented 6 years ago

Hello,

It seems that the linker is not able to find the static library libreactphysics3d.a. Do you have a repository with your code so that I can try to compile ?

Have you tried to add the reference to the static library by hand in your IDE (without the help of the target_link_libraries(Artemis "C:/reactphysics/lib/libreactphysics3d.a") line from your Makefile) ?

DanielChappuis commented 6 years ago

Hello,

Have you been able to solve your issue yet ? Can I close it ?

Flibio commented 6 years ago

I solved the issue in a different manner, by making Cmake simply build reactphysics instead of using the precompiled version.

DanielChappuis commented 6 years ago

Ok perfect thanks.