From 11025e6484e938239dc2db4f7ae50bb485c789b8 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 25 Dec 2016 12:35:06 +0100 Subject: [PATCH 1/2] Set include_directories in CMakeLists.txt --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9ca975..2e7e7e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,11 @@ cmake_minimum_required(VERSION 2.8) project(cstrike-basehook) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++14 -I./include -m32 -Wall -Wextra -Wpedantic") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++14 -m32 -Wall -Wextra -Wpedantic") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++ -m32 -lSDL2") +include_directories("include") + file(GLOB_RECURSE SOURCE_FILES src/*.cpp include/*.cpp) add_library(cstrike-basehook SHARED ${SOURCE_FILES}) From 974ef0cc33f51ba8b4d3b949dc8c65afae412b0d Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 25 Dec 2016 12:39:27 +0100 Subject: [PATCH 2/2] Link library against libGL Fixes unknown GL symbols: undefined symbol: glEnable (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glTexCoordPointer (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glPopAttrib (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glEnableClientState (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glMatrixMode (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glDisable (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glPushAttrib (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glLoadIdentity (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glBlendFunc (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glBindTexture (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glOrtho (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glDeleteTextures (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glDisableClientState (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glPixelStorei (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glGetIntegerv (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glDrawElements (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glTexImage2D (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glScissor (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glPushMatrix (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glVertexPointer (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glPopMatrix (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glViewport (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glColorPointer (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glTexParameteri (cmake-build-debug/libcstrike-basehook.so) undefined symbol: glGenTextures (cmake-build-debug/libcstrike-basehook.so) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e7e7e8..4e780a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8) project(cstrike-basehook) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++14 -m32 -Wall -Wextra -Wpedantic") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++ -m32 -lSDL2") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++ -m32") include_directories("include") @@ -10,4 +10,4 @@ file(GLOB_RECURSE SOURCE_FILES src/*.cpp include/*.cpp) add_library(cstrike-basehook SHARED ${SOURCE_FILES}) -target_link_libraries(cstrike-basehook) +target_link_libraries(cstrike-basehook SDL2 GL)