在阅读了一些关于 FastFormat 的信息后,我决定将它下载并安装在运行 OS X 10.8 的 Macbook Pro 上。我成功构建了 FastFormat,并运行了性能测试。然后我写了一个小测试来检查它是否有效:
#include <cstdlib>
#include <fastformat/fastformat.hpp>
#include <fastformat/sinks/ostream.hpp>
int main()
{
return EXIT_SUCCESS;
}
使用 g++-4.7 编译它(并确保所有包含路径都正确)后,我从 PlatformSTL 得到了编译时错误,如下面的错误。
error: #error Operating system not discriminated. Only UNIX and Windows are currently recognised by PlatformSTL
error: #error Operating system not discriminated
我试图通过定义unix
和PLATFORMSTL_OS_IS_UNIX
手动来抑制这些错误,但随后我收到了这些链接器错误:
Undefined symbols for architecture x86_64:
"_fastformat_exitProcess", referenced from:
fastformat::fastformat_initialiser::fastformat_initialiser() in ccMqErni.o
"_fastformat_getInitCodeString", referenced from:
fastformat::fastformat_initialiser::record_init_failure_(int) in ccMqErni.o
"_fastformat_init", referenced from:
fastformat::fastformat_initialiser::fastformat_initialiser() in ccMqErni.o
"_fastformat_uninit", referenced from:
fastformat::fastformat_initialiser::~fastformat_initialiser() in ccMqErni.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
OS X 是否支持 FastFormat,如果支持,我做错了什么?