c++ - 无法让 GLFW 与 g++ 链接
问题描述
好的,所以我正在尝试将 GLFW 链接到链接,但我遇到了麻烦。
这是控制台中的错误:
g++ -Iinclude -Llib -o out/main source/*.cpp
Undefined symbols for architecture x86_64:
"_glfwInit", referenced from:
_main in main-779346.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [main] Error 1
这是我的生成文件:
compiler = g++
main:
$(compiler) -Iinclude -Llib -o out/main source/*.cpp
./out/main
我在 macos 10.15.7 上并使用 Visual Studio Code 作为我的编辑器。希望有人能帮忙!
解决方案
推荐阅读
- python - 是否可以从文件中导入 pip 模块
- winapi - 为特定设备安装驱动程序
- reactjs - React Little State Machine 清除数据
- azure-devops - Azure DevOps 根据条件显示/隐藏字段
- ios - 如何从 iOS 查询 s3 数据库
- python - 如何在python中获取子列表的所有第一项
- office365 - 使用 Excel.createWorkbook(base64) 创建具有自定义名称的工作簿
- firebase - 找不到 com.google.firebase:firebase-analytics-ktx:。要求:项目:app
- angular - NavController 的 pop 和 back 没有按预期返回上一页
- javascript - 带引导程序的图像轮播