#I am genuinely losing my mind to this

17 messages · Page 1 of 1 (latest)

green tangle
#

not on a lot of sleep so maybe this is a simple problem but i have no idea why my include is not working, for context i am using clang, on vs code and am new to using vs as i used to use vs code 2022, i have my root dir, with a src dir, and a headers dir, i am trying to learn cmake, and make use of the target_sources command inside of the cmakelists.txt file but that is not my issues at least it think its not, i am just trying to do a simple include of a header file inside of my headers dir, the names line up and i have tried headers/header.hxx to no avail i just keep getting file not found error

jade mauveBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@green tangle

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

green tangle
#

error 'header.hxx' file not found

tardy oxide
green tangle
#

/ for root?

tardy oxide
shut steppe
#

Did you add headers as an include directory?

green tangle
#

just started learning cmake this is the file content ```cmake_minimum_required(VERSION 3.16)

project name and init setup

project(MyFirstCmake)

creates a "target" the target is the what gets complied usign the build system and src files you add

add_executable(MyFirstCmake)

used to later modify and add files to an existing target

target_sources(MyFirstCmake
PRIVATE
src/main.cxx

PUBLIC
FILE_SET Headers
TYPE HEADERS
BASE_DIRS headers
FILES headers/myHeader.hxx)```
shut steppe
#

Uh, target_include_directories(MyFirstCmake PRIVATE headers) I think

green tangle
#

the cmake part i did not even get to test yet since i could not figure out why the include was not working

tardy oxide
green tangle
tardy oxide
green tangle
#

only just started on cmake so hopefully it goes a bit smoother as i learn, it seems like a lot of docs/tutorials just assume you already know what u doing but thanks again 👍