macos - Mac OS:ld:找不到-lglfw的库
问题描述
构建我的项目我得到错误:
ld: library not found for -lglfw
clang: error: linker command failed with exit code 1 (use -v to see invocation)
但我已经安装了glfw
,通过brew install glfw
brew list --versions | grep glfw
glfw 3.2.1
ls /usr/local/lib | grep glfw
libglfw.3.2.dylib
libglfw.3.dylib
libglfw.dylib
clang -v
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
MacOS : 10.14.1 (18B75)
解决方案
看起来像添加export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
解决~/.bash_profile
了这个问题,但我不确定它是否是没有副作用的优雅解决方案。
推荐阅读
- reactjs - 使用 async/await 返回未定义的集合对象
- javascript - 如何在 NodeJS 中将音乐播放器同步到多个客户端
- nginx - 如果我将 www 放在 url 之前,则页面未找到错误
- javascript - 如何在 discord.js bot 上用新行替换
和替换? - dart - 在 Dart 中没有得到想要的 json 响应
- laravel - 如何在 Laravel 内置服务器上运行 Xdebug?
- javascript - 将 HTML 元素与 onscroll 链接,onchange 不起作用
- php - 通过它们扩展的测试用例类运行 phpunit 测试
- google-cloud-platform - GCP IPSEC 问题
- jpa - 春季启动中的 EmbbedId null