Comments (7)
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
You must link against OpenGL ( in mingw should be "opengl32" lib ).
from soil2.
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.
from soil2.
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:
target_link_libraries(${OPENGL_gl_LIBRARY})
it should be:
target_link_libraries(binaryname ${OPENGL_LIBRARIES})
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 ).
from soil2.
Original comment by Vadim Melnicuk (Bitbucket: vadimmelnicuk, GitHub: vadimmelnicuk).
I am trying to link against SOIL2 static library, that is libsoil2.a
I have also changed OPENGL_gl_LIBRARY to OPENGL_LIBRARIES, but soil still fails to find a reference to opengl functions.
from soil2.
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.
from soil2.
Original comment by Vadim Melnicuk (Bitbucket: vadimmelnicuk, GitHub: vadimmelnicuk).
Hello, Martin. Sorry for the late response. I have included my CMakeLists.txt below:
Also, this links well on linux and osx, windows complains about gl references though.
#!c
cmake_minimum_required(VERSION 3.6)
project(Neoconomy)
if (WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(SOURCE_FILES main.cpp HUGE_LIST_OF_FILES)
add_executable (${PROJECT_NAME} ${SOURCE_FILES})
find_package(OpenGL REQUIRED)
find_package(glew REQUIRED)
find_package(glfw3 3.2 REQUIRED)
find_package(soil2 REQUIRED)
if (WIN32)
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${SOIL2_LIBRARIES})
else ()
if (APPLE)
target_link_libraries(${PROJECT_NAME} "-framework CoreFoundation" ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${SOIL2_LIBRARIES})
else ()
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${SOIL2_LIBRARIES})
endif (APPLE)
endif (WIN32)
include_directories(${CMAKE_SOURCE_DIR}/include) # Header only libraries are found here
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLEW_INCLUDE_DIR}) # GLEW INCLUDE DIR DOI!
include_directories(${GLFW_INCLUDE_DIR}) # GLFW INCLUDE DIR DOI!
include_directories(${SOIL2_INCLUDE_DIR})
from soil2.
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.
from soil2.
Related Issues (20)
- HDR textures HOT 1
- Unable to compile HOT 1
- weird linking errors HOT 1
- SOIL_load_OGL_cubemap returning null type HOT 5
- How do I use SOIL2 HOT 16
- install issue macOS HOT 15
- Set GL_TEXTURE_MAX_LEVEL for DDS files with incomplete mip chain
- Add arg (Int*width and int*height) to function with XXX__OGL_XXX.
- Support uwp in vcpkg
- Unable to link static lib (Android)
- compiling SOIL2 with mingw64 gcc version 11.2.0 HOT 2
- Compiler Error VS2022 HOT 5
- lib version HOT 1
- Missing documentation HOT 1
- Cannot find source file in CMake HOT 1
- invalid strcmp
- Compiler warnings (clang) HOT 1
- SOIL2 is amazing but how without OpenGL ? HOT 2
- compiling SOIL2 with mingw64 gcc version 13.1.0 in windows 11 HOT 2
- Not usable with nanovg HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soil2.