Can't get GLFW working on Win10

I’ve spent last 2 days googling and trying many options and yet didn’t manage to get GLFW working. I’m using CLion with CMake to build a simple program:

#define GLFW_INCLUDE_VULKAN
#include <glfw3.h>

#include <iostream>

int main() {
    glfwInit();
    return 0;
}

And I used to veriants of CMakeList.txt

  1. Using GLFW Source Package:
cmake_minimum_required(VERSION 3.17)
project(ultima)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME} main.cpp )

set(GLFW_INCLUDE_DIRS C:/somewhere/tools/glfw-3.3.4/include/GLFW)
include_directories(${GLFW_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${GLFW_INCLUDE_DIRS}/glfw3.h)

With that I’m getting error like this:
main.cpp:13: undefined reference to glfwInit’`

  1. Using Windows Binaries:
cmake_minimum_required(VERSION 3.17)
project(ultima)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME} main.cpp )

set(GLFW_DLL_DIRS C:/somewhere/tools/glfw-3.3.4.bin.WIN64/lib-mingw-w64)
include_directories(${GLFW_DLL_DIRS})
target_link_libraries(${PROJECT_NAME} ${GLFW_DLL_DIRS}/libglfw3dll.a)

And with that I’m getting this:
main.cpp:2:10: fatal error: glfw3.h: No such file or directory

At this point I have to ask this in related forums and I’m out of options to search for.

Have you tried using:

I don’t know CLion very well, but this cmake package should work with the free Visual Studio Community edition.

That guide absolutely worked for me, thank you a lot for answering!

Excellent, glad this helped.