Suppose I have my library like this:
# Library
add_library(
MK
SHARED
Core.cpp
Graphics.cpp
)
# Linking Dependencies
target_link_libraries(MK PUBLIC ${GLEW_LIB})
target_link_libraries(MK PUBLIC ${GLFW_LIB})
if(BUILD_FOR_WINDOWS)
target_link_libraries(MK PUBLIC gdi32 user32 kernel32 opengl32)
target_link_libraries(MK PUBLIC -static -static-libgcc -static-libstdc++ -mwindows)
else()
target_link_libraries(MK PUBLIC GL)
endif()
That created the libMK.so file in my build directory. When I try to use it with the includes like this:
g++ Main.cpp -L./libMK.so -I include
It results into a lot of undefined reference errors as seen in my included image. An idea what could be wrong here?