然而,另一个" LD:符号(S)没有发现建筑x86_64的"问题与提升,此时用mgiza [英] Yet another "ld: symbol(s) not found for architecture x86_64" issue with boost, this time with mgiza
问题描述
对于我问这样一个共同的问题表示歉意;我无法找出有什么解决方案,工程或不够清晰,我实现。我只是想安装 mgiza 。这里是INSTALL文件:
I apologize for asking such a common question; I can't find any solution out there that works or is clear enough for me to implement. I am simply trying to install mgiza. Here is the INSTALL file:
cmake .
make
make install
If you want to install to a custom location, add the following flag when you run cmake:
-DCMAKE_INSTALL_PREFIX=/path/to/custom/location
NOTE: Boost Version 1.48 has problem with the code, you can use either 1.46 or 1.50+. Unfortunately 1.48 is shipped with Ubuntu 12.04 LTS, you can either download and compile libboost 1.50+ from their website, or just do this:
sudo apt-get install libboost1.46-all-dev
看起来很容易,不是吗?打字 cmake的。
工作没有任何明显的问题。不幸的是,制作
运行到这个可怕的错误(未定义符号...)与提升。
Looks easy, right? Typing in cmake .
works without any apparent problems. Unfortunately, make
runs into this dreaded error ("undefined symbols ...") with boost.
1 warning generated.
Linking CXX executable ../bin/d4norm
Undefined symbols for architecture x86_64:
"std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system-mt.a(error_code.o)
"std::string::_Rep::_S_empty_rep_storage", referenced from:
boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system-mt.a(error_code.o)
"std::string::assign(char const*, unsigned long)", referenced from:
boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system-mt.a(error_code.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system-mt.a(error_code.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system-mt.a(error_code.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
boost::system::(anonymous namespace)::generic_error_category::message(int) const in libboost_system-mt.a(error_code.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
基于其它问题,
,它与小牛的问题,因为它使用铛编译的C ++ code,这意味着该库的libc ++不的libstdc ++。对于完整性,以便其他人可以复制我的错误,我使用的OS X 10.9.5,X code 6.1,我的提升版本为1.56(升压是通过自制软件安装)。
Based on other questions, it's a problem with Mavericks because it uses clang to compile c++ code, implying that the library is libc++, not libstdc++. For completeness, and so that others can reproduce my errors, I am using OS X 10.9.5, Xcode 6.1, and my boost version is 1.56 (boost was installed via homebrew).
现在,必须有部分的修复在那里,对不对?让我们通过一些:
Now, there has to be some fix out there, right? Let's go through some of them:
- Applying在-m32标志:不适用,因为在Makefile
没有任何的g ++,在它,它也明确告诉我不要
编辑它,因为它是一个CMake的生成的文件。 - Not定义在一个头文件的东西:不适用,因为code应该可以编译
- Adding -stdlib = ++的libstdc到链接程序:我不知道怎么把它添加到
制作
命令?我试着只是做使-stdlib = ++的libstdc
键,而似乎为了避免上述错误,它引入了一些额外的错误:使:*** [全部]错误2
(不知道这是什么意思)。 - Linking适当Boost库:有评论那里,说:你只需要链接到正确的Boost库...大量的Q /关于如何做到这一点。不幸的是,我不认为任何的评论者联系,以解决我的问题的问题。
- Linking Qt的有升压:我不认为,因为我没有使用Qt这是适用的,我不知道我把在
LIBS + = [... ]升压
行。 - Linking缺少文件:这个问题似乎更多关于联运行
G ++
时,但我使用一个Makefile不具有G ++
中的任何地方。 - Using G ++ VS GCC :我不知道我怎样才能改变我使用的这些,因为我使用
cmake的
和制作
... - Changing链接命令:同样,我不知道我怎么可以改变从
cmake的
/编译使
到GCC
。 (注:从这点上来说,我将忽略通过添加一些与gcc或g ++回答最多的问题) - Changing标准C ++库:该解决方案包括进入X code和改变图书馆那里。我不认为这是正确的做法,在任何情况下,如果我改变了X code进行设置,我可能会搞砸了的东西(我也有X code'S GUI没有经验)。
- Linking图书馆X $ C $Ç:我觉得这是一个类似的案件为#9这个名单上。答案在这里也建议使用自制的MacPorts,而不是安装提振,但我已经早些时候说,我用自制软件安装的推动作用。
- 编译铿锵:?类似的问题,但我如何获得CMake的或作出铿锵编译
- 从(流行)比特币发行:现在的这个的看起来很有趣!一吨的人跑进我的错误。不幸的是,似乎没有共识或简单的解决方案。也有一些解决方案,我不知道实现。例如,一种解决方案是imbolo没有使用cxxflag标志编译提振,但到底是什么意思呢?
- Applying the -m32 flag: not applicable because the Makefile doesn't have any "g++" in it, and it also explicitly tells me NOT to edit it, because it's a "Cmake" generated file.
- Not defining something in a header file: not applicable because the code should be ready to compile.
- Adding -stdlib=libstdc++ to linker: I am not sure how to add this to a
make
command? I tried just doingmake -stdlib=libstdc++
and while that seemed to avoid the errors above, it introduced some additional errors:make: *** [all] Error 2
(not sure what that means). - Linking to proper boost libraries: There's a comment there that says "You just need to link to the proper boost libraries ... plenty of Q/As on how to do that". Unfortunately, I don't think any of the questions that commenter linked to address my problem.
- Linking Qt with boost: I don't think this is applicable because I'm not using Qt, and I don't know where I'd put in a
LIBS += [...] boost
line. - Linking a missing file: That issue seems to be more about linking when running
g++
but I'm using a Makefile that doesn't haveg++
anywhere in it. - Using g++ vs gcc: I don't know how I can change which of these I use, because I'm using
cmake
andmake
... - Changing a link command: Again, I don't know how I can change the compilation from
cmake
/make
togcc
. (Note: from this point on, I will ignore most questions that are answered by adding something to gcc or g++.) - Changing the standard c++ library: the solution involves going into Xcode and changing the libraries there. I don't think this is the correct approach and in any case I'd probably screw up something if I changed a setting in Xcode (I also have no experience with Xcode's GUI).
- Linking libraries in Xcode: I think this is a similar case as #9 on this list. The answer here also recommends using homebrew instead of macports for installing boost, but I already said earlier that I used homebrew for installing boost.
- Compile with clang: A similar issue, but how do I get cmake or make to compile with clang?
- From a (popular) bitcoin issue: Now this looks interesting! A ton of people ran into my error. Unfortunately, there seems to be no consensus or easy solution. There are also a few solutions that I don't know to implement. For instance, one solution by "imbolo" there is to compile boost using a cxxflag flag, but what does that mean?
所以我在亏损的关于如何正确安装mgiza ......我的意思是,mgiza整点给我 cmake的
一点点制作
是为了让我的不的担心编译事情繁琐的细节,对不对?这不只是一个mgiza问题,不过,因为我已经尝试做制作
其他地方时,遇到这个问题。我的理解(C)的Makefile高层的想法,而不是低层次的细节。
So I'm at a little bit of a loss on how to correctly install mgiza ... I mean, the whole point of mgiza giving me cmake
and make
is so that I don't have to worry about the messy details of compiling things, right? This isn't just an mgiza issue, though, since I've run into this problem when trying to do make
elsewhere. I understand the high-level ideas of (C)Makefiles, but not the low-level details.
推荐答案
要解决一些被评论者所关注的问题:解决这个问题的最好办法就是尽可能多地尝试清除您的系统启动进程从头开始。
To address some of the concerns by the commenters: the best way to deal with this problem is to try and clear your system as much as possible and start the process from scratch.
此外,由于此张贴,OS X 10.10优胜美地被释放,这可能有固定的这个问题(IIRC这个问题主要是由于10.9和铛/ GCC编译器的变化)。
Also, since this was posted, OS X 10.10 Yosemite was released, which may have fixed this problem (IIRC this problem is mostly due to 10.9 and the clang/gcc complier changes).
这篇关于然而,另一个&QUOT; LD:符号(S)没有发现建筑x86_64的&QUOT;问题与提升,此时用mgiza的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!