Answer the question
In order to leave comments, you need to log in
How to include a folder with headers?
Hello
In the folder with the compiler are the necessary files to work with winapi. I am writing through CLion and I need to somehow connect this folder, the environment does not want to index files connected via include
#include "tlhelp32.h"
CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); // Can't resolve variable //'CreateToolhelp32Snapshot'
include_directories(C:\\Program Files\\mingw-w64\\x86_64-7.3.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32\\include) #в этой папке tlhelp32.h
add_executable(untitled ... tlhelp32.h)
Answer the question
In order to leave comments, you need to log in
Isn't
it necessary through?
If I remember the pluses correctly, then in quotes we write the path relative to the current compilation unit.
The first thing that catches your eye is the presence of spaces in the path to the folder. Try putting it in quotes:
About the correctness:
Generally speaking, the use of include_directories is considered bad manners and the structure of modern CMake should be based on targets and properties. Your description lacks a bit of data to understand what you want to get. It would be nice if you could provide the full CMake code and describe what you are trying to get.
Or you can also check out my other answer on building an application with CMake.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question