quiet / libcorrect

C library for Convolutional codes and Reed-Solomon
BSD 3-Clause "New" or "Revised" License
362 stars 95 forks source link

Undefined symbols for architecture x86_64: #34

Closed Amaael-Aira closed 3 years ago

Amaael-Aira commented 3 years ago

Hello, I am trying to use the correct library to implement convolutional codes, however cannot get the linker to find the definitions of the functions after following the instructions for installation. The following error happens with every function I try to use:

Undefined symbols for architecture x86_64: "correct_convolutional_create(unsigned long, unsigned long, unsigned short const*)", referenced from: _main in main.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am including

include

and the CMakelLists.txt file is as follows

cmake_minimum_required(VERSION 3.16)

project(ConvCodeTest)

set(CMAKE_CXX_STANDARD 14)

add_executable(ConvCodeTest main.cpp) include_directories (/usr/local/include/) link_directories (/usr/local/lib/) target_link_libraries (ConvCodeTest /usr/local/lib/libcorrect.a) target_link_libraries (ConvCodeTest /usr/local/lib/libcorrect.dylib)

Finally, changing all paths to the build directory doesn't help either.