CLion IDE (CMake): Project builds but no intelligence for external libraries (GLFW)
Answered
I've implemented the GLFW basic example.
The GLFW header file is reported as not being found and such the CLion IDE is reporting and error and not providing intellisense however the project correctly compiles and runs.
I've added the GLFW library as per the guidance in their documentation (See CMakeLists.txt).
The project is being built and run remotely on Ubuntu 20.04.
main.cpp
#include <GLFW/glfw3.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
...
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(untitled1)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp)
find_package(glfw3 3.3 REQUIRED)
add_executable(untitled1 ${SOURCE_FILES})
target_link_libraries(untitled1 glfw)
Please sign in to leave a comment.
I've just tested with a GTK example and getting the exact same results. Builds and runs fine but no intellisense and reporting "'gtk/gtk.h' file not found".
main.cpp
CMakeLists.txt
Hello!
If you use the full remote mode, please try calling Tools | Resync with Remote Hosts - https://www.jetbrains.com/help/clion/remote-projects-support.html#resync.
Thanks Anna, that has resolved the issue!