7

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

I followed the README exactly, and got this error:

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: 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

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.

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

Any ideas?

Edit: 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)

h4x0rjax
  • 359
  • 1
  • 6
  • 15
  • "Undefined symbols for architecture x86_64" means that the library is built for some other architecture. The library target architecture could be 32 bit(i.e. i386). Find out how to build this library for 64 bit architecture(x86_64). – Raviprakash Jun 18 '14 at 04:24
  • Can you just have look at [this question](http://stackoverflow.com/questions/5334095/cmake-multiarchitecture-compilation) on compiling in 64 bit architecture using cmake. – Raviprakash Jun 18 '14 at 06:32
  • I did, and I attempted it. Unfortunately that did not fix the issue. – h4x0rjax Jun 18 '14 at 19:17

1 Answers1

2

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})

In your CMakeLists.txt file.

zcourts
  • 4,863
  • 6
  • 49
  • 74
  • I am new to CMake, so I need a little help here. I'm getting Undefined symbols for architecture x86_64 for boost. I am using CLion, which uses Cmake. This is what I have at the bottom of my CMakeLists.txt file: find_package(OpenCV REQUIRED) find_package(Boost 1.55.0 REQUIRED COMPONENTS filesystem thread chrono system atomic program_options) include_directories(${Boost_INCLUDE_DIRS}) add_executable(Oneprint ${SOURCE_FILES}) target_link_libraries(Oneprint ${OpenCV_LIBS}) target_link_libraries(Oneprint ${Boost_LIBRARIES}) How would I use your above suggestion (actual name or alias)? – Patricia Mar 25 '15 at 16:38