0

I am setting up my developer environment for Vulkan I

  1. Configured the includes
  2. Put the needed libraries into Build Phases -> Link Binary With Libraries
  3. Put copies of these libraries in Build Phases -> Copy Files

It compiled fine but I keep on getting this error:

dyld: Library not loaded: @rpath/libvulkan.1.dylib

Reason: no suitable image found.  Did find:
/Users/XXXX/Library/Developer/Xcode/DerivedData/XXX-dkhzbaxqioiysvffldpdiujtlvou/Build/Products/Debug/libvulkan.1.dylib:

Here is my code(I don't think it is the code if it compiles but just in case):

#include <GLFW/glfw3.h>

#include <iostream>
#include <stdexcept>
#include <cstdlib>

const uint32_t WIDTH = 800;
const uint32_t HEIGHT = 600;

class HelloTriangleApplication {
public:
    void run() {
        initWindow();
        initVulkan();
        mainLoop();
        cleanup();
    }

private:
    GLFWwindow* window;

    void initWindow() {
        glfwInit();

        glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
        glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);

        window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan", nullptr, nullptr);
    }

    void initVulkan() {

    }

    void mainLoop() {
        while (!glfwWindowShouldClose(window)) {
            glfwPollEvents();
        }
    }

    void cleanup() {
        glfwDestroyWindow(window);

        glfwTerminate();
    }
};

int main() {
    HelloTriangleApplication app;

    try {
        app.run();
    } catch (const std::exception& e) {
        std::cerr << e.what() << std::endl;
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}

0 Answers0