-
Notifications
You must be signed in to change notification settings - Fork 74
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
Undefined reference while linking in Windows #14
Comments
Original comment by Vadim Melnicuk (Bitbucket: vadimmelnicuk, GitHub: vadimmelnicuk). I have linked opengl32 using find_package(OpenGL REQUIRED) and target_link_libraries(${OPENGL_gl_LIBRARY}) later. I am also including <GL/glew.h> before <SOIL2.h>. Neither glfw nor glew complain about opengl references. |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). I don't use CMake, but i did a quick test and builded without problems. I'm pretty sure that your mistake is here:
it should be:
You can see the CMakeLists file that i created, here: http://pastebin.com/aVvrt6Nx ( if you wan't to use it you'll need to get the FindSDL2.cmake file from here: https://github.com/tcbrindle/sdl2-cmake-scripts ( and place it in the subfolder cmake ). And used mingw to build it ( cmake -G "MinGW Makefiles" CMakeLists.txt ). |
Original comment by Vadim Melnicuk (Bitbucket: vadimmelnicuk, GitHub: vadimmelnicuk). I am trying to link against SOIL2 static library, that is libsoil2.a |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). If you want to, you can show me the CMakeList.txt that you are using. But since i don't even know more than the basics of CMake and i don't provide support for CMake with the library, i think that it would be more appropriate to ask how to solve your issue in a CMake forum, since it's not a problem with SOIL but with your Makefile generation. Anyways, show me your CMake file at least to see if i can help. |
Original comment by Vadim Melnicuk (Bitbucket: vadimmelnicuk, GitHub: vadimmelnicuk). Hello, Martin. Sorry for the late response. I have included my CMakeLists.txt below:
|
Original comment by Rubick (Bitbucket: CuriousRubick, GitHub: CuriousRubick). I fixed this problem by simply linking SOIL2 before opengl32.lib . If using Codeblocks, go to build options -> linker settings, and move SOIL2 above opengl. Wasn't an issue in Visual Studio. |
Original report by Vadim Melnicuk (Bitbucket: vadimmelnicuk, GitHub: vadimmelnicuk).
I am getting the list of following errors while linking static library on Windows using CMake:
The text was updated successfully, but these errors were encountered: