c++ - 在 Mac 上构建的 HPX 出现链接器错误

标签 c++ macos gcc linker hpx

我正在尝试在 OS X Yosemite 上构建 HPX。我在运行命令“make”时收到以下链接器错误。

我使用 gcc 作为我的编译器。

    Linking CXX shared library ../lib/libhpx.dylib
0  0x1056e66a0  __assert_rtn + 144
1  0x105791989  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 3169
2  0x105775331  mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 375
3  0x1056e9344  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 784
4  0x1056eb1fc  ld::tool::InputFiles::parseWorkerThread() + 484
5  0x7fff945d9268  _pthread_body + 131
6  0x7fff945d91e5  _pthread_body + 0
A linker snapshot was created at:
        /tmp/libhpx.0.9.11.dylib-2015-06-18-214035.ld-snapshot
ld: Assertion failed: (cfiStartsArray[i] != cfiStartsArray[i-1]), function parse, file src/ld/parsers/macho_relocatable_file.cpp, line 1741.
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libhpx.0.9.11.dylib] Error 1
make[1]: *** [src/CMakeFiles/hpx.dir/all] Error 2
make: *** [all] Error 2

最佳答案

尝试如下配置 hpx;

/Users/hpx > ./configure --with-hwloc=contrib --prefix=/Users/hpx/install CC=clang


/Users/hpx > make

您发布的错误与优胜美地中的 gcc 和链接器有关。 仍然不确定如何准确解决错误。 但作为变通方法,您可以在编译 HPX 时使用 clang 编译器。

关于c++ - 在 Mac 上构建的 HPX 出现链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31493252/

相关文章:

c++ - 以我的方式向后写一个字符串,有时会导致额外的输出,与字符 ' w ' 相关

python IDLE vs Mac终端打印语句

xcode - IOSOpenDev 安装失败

c++ - 在 Windows 中使用 DevC++ 和在 Ubuntu 中使用 gcc 写入文件有什么区别

c++ - 在进行基准测试时防止编译器优化

c++ - 如何按值对数组进行排序(排序)? *有一个转折*

c++ - 我如何(优雅地)终止 gSOAP 服务器?

macos - 如何启用 MKMapView 3D View ?

c++ - 函数模板中的 lambda 闭包类型和默认参数

c++ - 将 C++ 代码移植到 Python