user2464424 user2464424 - 1 year ago 283
C Question

setting up vulkan for code::blocks via glfw or lunarg

I have code::blocks and a spare evening, would like to put my hands on vulkan. Now on windows 7.

I'm having troubles finding any documentation/tutorials nor the libraries to work in codeblocks. I have glfw 3.2 but it requires a vulkan library and headers as well to work with it (

) otherwise it rightfully complains about a missing
. Also installed LunarG, but can't find any recognizable libraries in the package that i could link via the linker settings in the usual way.

My code right now is straightforward:

#include <GL/glu.h>
#include <GLFW/glfw3.h>

int main(int argc, char **argv) {
return glfwVulkanSupported();

-lglu32 -lglfw3 -lopengl32 -lgdi32

Basically all i think i need is a library to link to but can't find any on the web.

Answer Source
  1. Using the old GLU library may not be a good idea with Vulkan

  2. Instal the LunarG SDK.

  3. Set additional include directory in your IDE project: $VULKAN_SDK/Include (VULKAN_SDK is an env variable with a path to root of the SDK).

  4. Do not link against OpenGL if you are only going to use Vulkan.

  5. Code::Blocks is g++ or clang based right? Link against the vulkan-1.dll. -lvulkan-1 should suffice, because the path should be in PATH. Otherwise provide the path with -L — it is in $WINDIR/System32 (for x64 and x32 OS) and in $WINDIR/SysWOW64 (for x32 app on x64 OS).

vulkan-1.dll is installed there by drivers and by the SDK also.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download