无法将我的 MacPorts 库包含在 scons 脚本中
我对命令行方面还很陌生……目前正在尝试在我运行雪豹的 2007 年 MacBook Pro 上编译一些主要用 C++ 构建的库项目。我试图使用 MacPorts 下载一些必要的库,这将它们放在 opt/local/... 中,这不是默认搜索路径。我知道,如果我正在编译单独的 c++ 程序,我可以在运行 g++ 时使用 -L 标记,但实际上我正在运行一次编译数十行的 scons 脚本。我无法在这些程序中放置数十或数百个 -L 标签。
我不知道如何将 /opt/local 添加到 gcc/g++ 的默认库目录,也不知道如何将这些 Macports 安装的库从 /opt/local 获取到默认目录。我认为两者都应该有效。我在另一个板上看到了一个相关主题,建议重新编译 gcc,但我使用的是 Xcode 附带的旧版本 gcc,我不想冒险用 Xcode 搞砸事情,除非我知道这是唯一的方法。
I'm pretty new at command line stuff...currently trying to compile some library projects that are mostly built in C++, on my 2007-era MacBook Pro running snow leopard. I was trying to download some necessary libraries using MacPorts, which places them in opt/local/... which is not a default search path. I know that if I was compiling individual c++ programs I could just use the -L tag when running g++ but I am actually running scons scripts which compile dozens of lines at a time. I can't place dozens or hundreds of -L tags throughout these programs.
I don't know how to add /opt/local to the default library directories for gcc/g++ and I don't know how to get these Macports-installed libraries from /opt/local into a default directory. I would think either should work. I saw a related topic on a different board that recommended recompiling gcc, but I am using the older version of gcc which came with Xcode, I'd rather not risk screwing things up with Xcode unless I know that is the only way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将“/opt/local/lib”添加到 SCons 构建系统的 Environment() 中的 LIBPATH 中。
Try adding '/opt/local/lib' to the LIBPATH in the Environment() in the SCons build system.