我不能用 premake5 添加额外的库

I cannot add additional libraries with premake5

我正在学习OpenGL和GLFW,我决定使用premake5,因为它看起来易于使用和维护。我的项目位于名为 LearningOpenGL 的文件夹中。我在 MAC.

Project structure.

Application.cpp

#include <GLFW/glfw3.h>
#include <iostream>

int main(void)
{
GLFWwindow* window;

/* Initialize the library */
if (!glfwInit())
    return -1;

/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window)
{
    glfwTerminate();
    return -1;
}

/* Make the window's context current */
glfwMakeContextCurrent(window);

/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window))
{
    /* Render here */
    glClear(GL_COLOR_BUFFER_BIT);

    /* Swap front and back buffers */
    glfwSwapBuffers(window);

    /* Poll for and process events */
    glfwPollEvents();
}

glfwTerminate();
return 0;
}

premake5.lua

workspace "LearningOpenGL"
    configurations { "Debug", "Release" }

outputdir = "%{cfg.buildcfg}-%{cfg.system}"

project "LearningOpenGL"
    kind "ConsoleApp"
    language "C++"
    targetdir ("bin/" .. outputdir .. "/%{prj.name}")
    objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

    files { 
        "%{prj.name}/src/**.h", 
        "%{prj.name}/src/**.cc"
    }

    -- including GLFW headers
    includedirs "%{prj.name}/vender/GLFW/include"

    -- linking with GLFW
    libdirs "LearningOpenGL/vender/GLFW/lib-macos"
    links "libglfw3.a"


    filter "configurations:Debug"
        defines { "DEBUG" }
        symbols "On"

    filter "configurations:Release"
        defines { "NDEBUG" }
        optimize "On"

当我做的时候

vender/bin/premake/premake5 gmake

Building configurations... Running action 'gmake'... Generated LearningOpenGL.make... Done (36ms).

然后

make

从终端给我这个错误,我无法解决。

==== Building LearningOpenGL (debug) ==== Linking LearningOpenGL ld: library not found for -llibglfw3.a clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [bin/Debug-macosx/LearningOpenGL/LearningOpenGL] Error 1 make: * [LearningOpenGL] Error 2

此外,还有其他易于使用的项目管理器可以代替 premake 吗?

应该是:

links "glfw3"

linkoptions "-llibglfw3.a"