I’ve been learning Cpp for a little while now, and I want to import libraires and such. But I haven’t been able to import and use anything so far… I downloaded the binaries for GLFW, copied the include folder into my CLion project’s root folder. And then what? I’m supposed to link it, but HOW??? There’s no help whatsoever, everyone on every tutorial just acts like it’s already done and it’s magic or you already OBVIOUSLY know how to do it.
I have no idea what I’m doing, I will probably get roasted bc this platform is toxic, but can someone just help me please ????
So far this is the error I’m getting:
====================[ Build | LearnOpenGL | Debug ]=============================
"C:Program FilesCMakebincmake.exe" --build C:devLearnOpenGLcmake-build-debug --target LearnOpenGL -j 10
[0/1] Re-running CMake...
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:6 (find_package):
By not providing "FindGLFW.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "GLFW", but
CMake did not find one.
Could not find a package configuration file provided by "GLFW" with any of
the following names:
GLFWConfig.cmake
glfw-config.cmake
Add the installation prefix of "GLFW" to CMAKE_PREFIX_PATH or set
"GLFW_DIR" to a directory containing one of the above files. If "GLFW"
provides a separate development package or SDK, be sure it has been
installed.
ninja: error: rebuilding 'build.ninja': subcommand failed
-- Configuring incomplete, errors occurred!
FAILED: build.ninja
"C:Program FilesCMakebincmake.exe" --regenerate-during-build -SC:devLearnOpenGL -BC:devLearnOpenGLcmake-build-debug
So far my CMakeLists.txt looks like that…
cmake_minimum_required(VERSION 3.0)
project(LearnOpenGL)
set(CMAKE_CXX_STANDARD 23)
find_package(GLFW REQUIRED)
add_executable(LearnOpenGL main.cpp)
include_directories(./include)
target_link_libraries("${CMAKE_PROJECT_NAME}" PRIVATE glfw)
Project structure is something like:
Root
|-- include
| |-- GLFW
| | |-- glfw3.h
| | |-- glfwnative.h
|-- CMakeLists.txt
|-- main.cpp
But it’s not linking or something… Not sure 🙁