I thought I should report my attempt to integrate this with Urho shared build and mingw-w64 toolchain. If it can save anyone the time I spent even with the help of rokups (thanks!) that could save a lot of work… or maybe I’m just missing something, like in cmake.
It’s not easy to find a GLEW 64-bit shared library (.dll.a). I managed to build it [edit: with ‘make glew.lib’, but default target had errors]
It turned out I also needed to ‘make extensions’ - which I found uses many Unix tools so the quickest method was to use MSYS2 and install x86_64 gcc, make, python, git, etc.
Maybe GLEW can and will be optional in the future, as suggested in a nuklear Issues thread.
This integration is with SDL2, and I chose to use the includes and link to the library from Urho itself.
But all the time, I am getting these errors:
In function nk_sdl_device_create()': src/nuklear_sdl_gl3.h:98: undefined reference to
__imp_glCreateProgram’ [and many more like it]
Urho3D passes defines to downstream projects, in this case GLEW_STATIC, but #undef it or removing from the generated makefile does not seem to affect the linking.
Part of my CMakeLists.txt …
set(SDL_LIBRARY "/urho/build/Source/ThirdParty/SDL/libSDL.a")
add_definitions(-DGLEW_BUILD -DGLEW_NO_GLU)
set(GLEW_INCLUDE_DIR "glew-2.0.0/include/GL")
set(GLEW_LIBRARY_DIR "glew-2.0.0/lib")
find_path(GLEW_INCLUDE_DIR glew.h
PATHS ${GLEW_INCLUDE_DIR})
set(GLEW_NAMES libglew32.dll.a glew32)
find_library(GLEW_LIBRARY
NAMES ${GLEW_NAMES}
PATHS ${GLEW_LIBRARY_DIR})
find_package(GLEW REQUIRED)
if(GLEW_FOUND)
list(APPEND INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
message("Found GLEW library: ${GLEW_LIBRARY}")
else()
message("---- GLEW NOT FOUND")
endif()
list(APPEND ABSOLUTE_PATH_LIBS ${SDL_LIBRARY} ${GLEW_LIBRARY})
list(APPEND LIBS opengl32 glu32)
setup_main_executable()
Good luck!
I have been wanting to shift my main dev platform to Linux for a while… edit: and I’ve done this