Unable to build LunarG Vulkan Samples

This topic contains 6 replies, has 4 voices, and was last updated by  superbigio 1 year, 1 month ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #1137

    Pixel Music

    I am pretty new to programming IDEs in Mac,
    Trying to setup Vulkan demos..

    facing below build issue :-
    Molten-0.13.0/MoltenVK/Demos/LunarG-VulkanSamples/API-Samples/macOS/DemoViewController.mm:16:9: ‘QuartzCore/CAMetalLayer.h’ file not found

    Details :–
    OSX Version : 10.11.6 (15G31)
    MacBook Pro (Retina, 15-inch, Mid 2014)


    Bill Hollings


    Starting with a clean Molten 0.13.0 download, and following the instructions, we are not able to replicate this here with either Xcode 7.3.1 (7D1014) or Xcode 8.0 beta 6 (8S201h).

    It should not matter, but what version of Xcode are you using? And did you change the Xcode project in any way prior to attempting to build the demo?




    You are likely accidentally building the iOS versions of the product for the simulator, and the simulator does not support Metal.

    You either have to build and deploy on actual hardware, or build and deploy for your desktop mac.



    Okay, I’m clearly missing something about the framework build. I’m seeing the same issues from the command line.

    I use this to compile:
    c++ -std=c++14 -I/Users/andrewl/MoltenVK/Molten-0.13.0/MoltenVK/include -o VulkanTest main.cpp -framework Cocoa -F/Users/andrewl/moltenvk/Molten-0.13.0/MoltenVK/macOS -framework MoltenVK -framework Metal

    This program:

    #include <iostream>
    #include <vulkan/vulkan.h>
    int main() {
        uint32_t extensionCount = 0;
        vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);
        std::cout << extensionCount << " extensions supported" << std::endl;

    And I get this error:

    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_CAMetalLayer", referenced from:
          l_OBJC_$_CATEGORY_CAMetalLayer_$_Molten in MoltenVK(MoltenVK-x86_64-master.o)
          objc-class-ref in MoltenVK(MoltenVK-x86_64-master.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Bill Hollings


    CAMetalLayer is part of the QuartzCore system framework…so you need to link in that framework as well.

    Unfortunately, the README_MoltenVK_UserGuide.md document does not mention that, which is a documentation oversight.





    Thanks. That got it. Now I can walk through tutorials.

    $ ./VulkanTest
    4 extensions supported



    Hi there,
    I had the same problem and managed to solve it thanks to this thread, however it seems that beside the QuartzCore.framework more frameworks are needed in order to successfully compile code using MoltenVK. In my experience also the Foundation.framework and the Metal.framework are needed. I know it’s kind of obvious, however it would be great if the docs could mention those as well. Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.