#Installed SDK on custom directory, but it still includes headers from `/usr/include` , why ?
121 messages Β· Page 1 of 1 (latest)
How are you building the project?
with vscode/cmake
post code
/usr/include is a default search path for include files, and so if you are using find_package(Vulkan) it may be picking them up from there.
cmake_minimum_required(VERSION 3.29)
project(TEST1 VERSION 0.1.0 LANGUAGES C CXX)
find_package(Vulkan REQUIRED)
add_executable(Main "main.cpp")
target_link_libraries(Main PRIVATE Vulkan::Vulkan)```
as simple as that
then what's the point of include dirs of SDK if it will read from usr/include anyway
im not sure what you mean
should I set include variable there in /etc/enviroment too ?
I want headers from sdk directory not from /usr/include
Okay, did you clean out your cache before re-runnning cmake?
and you are sure VULKAN_SDK is set in the environment you are running cmake in?
will check that , with $ENV .. a sec
message("TEST: " $ENV{VULKAN_SDK})
correct ?
yeah
well thats good
here is print
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64/bin"
VULKAN_SDK="/mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64"
LD_LIBRARY_PATH="/mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64/lib"
VK_LAYER_PATH="/mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64/share/vulkan/explicit_layer.d"
VK_ADD_LAYER_PATH="/mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64/share/vulkan/explicit_layer.d"```
here I just don't see INCLUDE dir variable
shoudn't it be there ?
FYI you do have /usr/<bin> in your path ahead of the VULKAN_SDK path
There isn't one - cmake uses the VULKAN_SDK in how it searches for paths.
the source code is here https://github.com/Kitware/CMake/blob/master/Modules/FindVulkan.cmake
can you post your full cmake configure log?
yes I have /mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64/bin bin here so when I'm doing find_package() it will search include dirs from what's written in FindVulkan.cmake right ?
where can I find that log ?
will post ofc
yes, in a general sense (it doesn't use /bin directly in the FindVulkan.cmake, it just uses VULKAN_SDK/include)
uhhhh generally in your build folder
if it uses VULKAN_SDK/include then something wrong here cuz VULKAN_SDK is pointing to mounted partition correctly where I have SDK
It'll be in the CMakeFiles then
ninja_log isn't useful, thats after you configured cmake. CMakeCache.txt would be useful
well your cache says you have the right include path
//Path to a file.
Vulkan_INCLUDE_DIR:PATH=/mnt/b1b56d51-33ac-4613-a905-03b004de143d/VulkanSDK/1.3.283.0/x86_64/include
correct , I knew that by printing that variable after find_package populates vartiables
what's the issue ? π¦
okay I do not see the log from cmake where I thought I would.
included from /usr/include
Oh how are you "getting" to vulkan.h? Just hitting f12?
you might be getting what "intellisense" is using rather than what the compiler is getting
if you delete your cache and reconfigure, the 'log' is printed to the vscode console. can you copy that?
another very strange thing what happens here , maybe that will be hint on what's going on
it sees vulkan includes even without clean project
not need to ask for vulkan
are you using the vs code cmake plugin?
Do you have a "c_cpp_properties.json" in your project?
That might override the include directories
also check for a settings.json
they're usually in the (sometimes hidden) .vscode folder
I don't havethem too , I don't have .vscode dir there at all
intelisense is provided by a separate plugin, that plugin did not use the cmake plugin to detect the paths
I see that compile_commands.json was generated, which is a good sign
think that is intellisense ?
because its in /usr/include, a default search path
I think so - I sometimes am bit by intellisense and cmake not matching
compile_commands.json is a clangd file so it would only work with clangd intelisense not the standard cpp intelisense from microsoft
I woudn't be able to include vulkan like that yesterday
you can't just #include <vulkan/vulkan.h>
in empty project, but now I can ..
really? damn
I mean afaik π
If you can include in a new empty project, you probably have a global include path settings (file) setup
which I didn't craete, in other words something happened and now I can't get to default state π¦ ...
No, this documentation indicates intellisense can use compile_commands.json
ohhhhh
Can you check the C_Cpp.default.includePath setting in vscode?
ofc , a sec
you migth have setup include paths for your user
@rigid canopy
A custom configuration provider is another extension in VS Code that can potentially provide more accurate C++ IntelliSense configuration than the C/C++ extension.
To add an extension as a configuration provider, either select the extension through the configuration Quick Pick, add it to configuration UI by editing the Configuration provider field under Advanced Settings, or add the configurationProvider field to your c_cpp_properties.json file. For example, for the CMake extension, the path to add would be ms-vscode.cmake-tools.
And C_Cpp.default.systemIncludePath ?
nope
cmake_minimum_required(VERSION 3.29)
project(TEST2 VERSION 0.1.0 LANGUAGES C CXX)
add_executable(TEST2 main.cpp)
``` clean project new directory
π
but not funny .. it's easier to set off the rocket I guess
I have cockroach entry somewhere that refuses to wipe itself from list
I didn't included anything .. really
that started after I added variables
and I'm also able to create VkInstance
VkInstance i{};
what
afaik I need a libs for that ... no ?
no
all you did was declare a pointer
creating an instance requires calling vkCreateInstance, otherwise its not different than Foo* foo {};
hmm ok got that .. anyway thanks for help . will dig further dunno what's the binary evil is going on here π
VkApplicationInfo AppInfo{};
AppInfo.apiVersion = VK_API_VERSION_1_3;```
that isn't pointer but possbile too
yeah, VkApplicationInfo is just a struct
and VkInstance is a 'dispatchable handle' which akin to a uint64_t value (but it is a pointer, just to an opaque type)
When you say "create an instance" you are meaning "creating a Vulkan Instance Object" which requires calling Vulkan API calls which perform the necessary internal logic to create an instance. You get access to that instance from the VkInstance handle that is returned from vkCreateInstance (well, out parameter). Hence why you can't just create an instance with VkInstance instance{};
yes I was not be able to pass this ```cpp
VkInstance I;
int main(int, char**)
{
VkInstance i{};
VkApplicationInfo AppInfo{};
AppInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
AppInfo.apiVersion = VK_API_VERSION_1_3;
VkInstanceCreateInfo InstanceC{};
InstanceC.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
InstanceC.pApplicationInfo = &AppInfo;
auto x = vkCreateInstance(&InstanceC, nullptr, &I);
if (x != VK_SUCCESS)
{
}
}``` I just panicing maybe it also links the libs some hidden way π
but looks like it only includes from somewhere ...