“Undefined symbols for architecture x86_64:” [英] "Undefined symbols for architecture x86_64:"

查看:1754
本文介绍了“Undefined symbols for architecture x86_64:”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在mac os x Mavericks 10.9.3 64位元上编译这个程式库: http://www.openfec。 org / downloads.html

I am attempting to compile this library on mac os x Mavericks 10.9.3 64-bit: http://www.openfec.org/downloads.html

我完全按照README,出现了这个错误:

I followed the README exactly, and got this error:


链接C共享库../../ bin / Release / libopenfec.dylib

Linking C shared library ../../bin/Release/libopenfec.dylib

   Undefined symbols for architecture x86_64:
      "_of_add_from_multiple_symbols", referenced from:
         _of_linear_binary_code_backward_substitution in of_ml_tool.c.o
      "_of_add_to_symbol", referenced from:
         _of_linear_binary_code_decode_with_new_symbol in of_it_decoding.c.o
         _of_linear_binary_code_simplify_linear_system in of_ml_decoding.c.o
         _of_linear_binary_code_col_forward_elimination_pivot_reordering in of_ml_tool.c.o
         _of_linear_binary_code_apply_gauss_pivoting in of_ml_tool_2.c.o
         _of_linear_binary_code_inject_symbol_in_triangular_system in of_ml_tool_2.c.o
         _of_linear_binary_code_solve_triangular_system in of_ml_tool_2.c.o
         _of_linear_binary_code_invert_dense_system in of_ml_tool_2.c.o
         ...
      "_of_calloc", referenced from...:
         ...

ld:没有为架构x86_64找到符号

clang:error:linker命令失败,退出代码为1(使用-v查看调用)

make [2]: * [../bin/Release/libopenfec.dylib]错误1

make [1]:*
[src / CMakeFiles / openfec.dir / all]错误2

make: * [全部]错误2

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: * [../bin/Release/libopenfec.dylib] Error 1
make[1]: *
[src/CMakeFiles/openfec.dir/all] Error 2
make: * [all] Error 2

OpenFEC发行版的README(位于 http://www.openfec.org/downloads.html )。尝试创建时,会出现此错误。
我不知道是什么问题。

I simply followed the README for OpenFEC's distro (found at http://www.openfec.org/downloads.html). When attempting to make, this error arises. I have no idea what the problem is.

这是我在解压缩分配后做的:

(1.): mkdir build

(2.):cd build

(3.):cmake .. -DDEBUG:STRING = OFF

(4.):make

This is what I did after untarring the distribution:
(1.): mkdir build
(2.): cd build
(3.): cmake .. -DDEBUG:STRING=OFF
(4.): make

任何想法?

编辑:尝试强制cmake使用64位, 。

(试图将其强制为32位只是为了踢,也没有工作)

Attempted to force cmake to use 64-bit, still didn't work.
(Tried to force it into 32-bit just for kicks, also didn't work)

推荐答案

FYI,如果这没有解决。检查您是否正确连接到您的库。

FYI, if this wasn't resolved. Check that you're linking to your libraries properly.

FIND_LIBRARY(LIB_NAME_LIB lib)
TARGET_LINK_LIBRARIES(my_executable ${LIB_NAME_LIB})

在您的CMakeLists.txt文件中。

In your CMakeLists.txt file.

这篇关于“Undefined symbols for architecture x86_64:”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆