在XCode 3.2中链接Boost文件系统(MacPorts)

Mar*_*tin 3 macos xcode boost macports boost-filesystem

我正在使用XCode 3.2并使用MacPorts项目(发布和调试)安装了boost但是我无法让我的应用程序与boost :: filesystem链接

我已将库搜索路径设置为/ opt/local/lib,但在链接项目时仍然会得到未解析的引用.

我注意到在另一篇文章中将-lboost_system添加到"其他链接器标志"但是当我这样做时,我得到了 - libboost_system.dylib,文件是为不支持的文件格式构建的,而不是被链接的体系结构(i386).

MacPorts没有安装正确的库还是我错过了其他的东西?

马丁

Ste*_*Chu 5

您没有说明您使用的操作系统版本.我的猜测是,在构建和安装端口时,MacPort默认为x64.从MacPort 卸载 boost,然后使用通用体重新安装.

%% sudo port uninstall boost
%% sudo port install boost +universal
Run Code Online (Sandbox Code Playgroud)