Premake5: GLFW 项目不能在项目类型下编译 "ConsoleApp"

Premake5: GLFW project does not compile under project kind "ConsoleApp"

当我在 Premake 文件中将项目类型设置为“ConsoleApp”时,我遇到了一个奇怪的问题,即我的 GLFW 项目无法编译(我使用 Mingw64 作为我的编译器)。当项目种类设置为“WindowedApp”时,它工作得很好,但我想要调试功能。这是我的 Premake 文件:

workspace "EatOrDie"
    architecture "x64"

    configurations {
        "Debug",
        "Release"
    }

output_dir = "%{cfg.system}-%{cfg.architecture}-%{cfg.buildcfg}"

project "EatOrDie"
    location "projects"
    kind "WindowedApp"
    language "C++"

    targetdir ("builds/bin/" .. output_dir .. "/%{prj.name}")
    objdir ("builds/obj/" .. output_dir .. "/%{prj.name}")

    files {
        "src/**.h",
        "src/**.c",
        "src/**.hpp",
        "src/**.cpp"
    }

    includedirs {
        "vendor/glfw-3.3.2.bin.WIN64/include",
        "${VULKAN_SDK}/include/"
    }

    links {
        "vendor/glfw-3.3.2.bin.WIN64/lib-mingw-w64/glfw3",
        "${VULKAN_SDK}/lib/vulkan-1"
    }

该项目将编译。但是,当我将项目类型设置为“ConsoleApp”时,它会给我未定义的引用。

小错误。我必须 link 带有 gdi32 的项目才能显示 window。