#How do I add Vulkan with GCC, MinGW and o64-clang?

55 messages · Page 1 of 1 (latest)

sharp root
#

How do I add Vulkan with GCC, MinGW and o64-clang? Currently I am using Linux Ubuntu 24.10

queen locust
#

Know the specification you have downloaded. If on Windows (which I assume you are), you will find that in C:\VulkanSDK\your spec version. If you have not yet downloaded the SDK, head to https://www.lunarg.com/vulkan-sdk/ and follow the setup process. You will want to specify your include flag to be the path to the \Include folder within the SDK (e.g. -I"C:\VulkanSDK\1.4.304\Include") and your linker flag to be the same, but for the \Lib folder instead (e.g. -I"C:\VulkanSDK\1.4.304\Lib"). There may also be an environment variable such as VULKAN_SDK or VK_SDK_PATH which will automatically fill out "C:\VulkanSDK\spec" for you. You then simply need to include Vulkan through "#include <vulkan/vulkan.h>".

sharp root
queen locust
#

are you using windows?

sharp root
queen locust
#

if you're using Linux then how are you using MinGW?

toxic dagger
#

probably mingw cross compiler - to build windows programs from a linux environment

untold fable
fluid igloo
#

Have you used a build system such as make or CMake before?

untold fable
#

Yes I just used make

#

I also had a batch file

#

I just realized 😭

sharp root
sharp root
sharp galleon
sharp root
#

but on linux we install mingw running

#

sudo apt install mingw

#

for debian distributions

sharp galleon
#

that is fine, but no lib will have a mingw package, you have to compile everything yourself

sharp galleon
#

what library has a mingw package?

sharp root
#

Like ones of boost

#

can be used to build an app for windows with mingw

sharp galleon
#

*only dynamic libs

sharp root
#

i've tested

sharp root
sharp galleon
#

not always

sharp root
sharp galleon
#

so you have not yet stated what is the problem you are having other than "how"

sharp root
untold fable
#

I've been doing mingw headers for a long time but bunding crt is a bit annoying if you don't want to link it statically because nobody in the universe has mingw installed.

#

But I've been avoiding it all together by only using winapi with mingw headers

#

this way you don't need crt

untold fable
sharp galleon
untold fable
#

and you will have crt in your file

sharp galleon
#

that's clang not gcc

untold fable
#

yes its the same

#

clang comes without headers

#

you can do it with gcc

#

same result

sharp galleon
#

and we're talking about linking msvc built static libs here not static libs in general

untold fable
#

you can link them

#

but you have to put the paths

#

doesn't instantly work out of the box on mingw's gcc

#

but does work in clang actually!

#

--target=x86_64-pc-windows-msvc

#

which is... the default target

#

(on windows)

#

ofc -static