I am trying to add an external library, called OpenAlpr, with alpr.h and openalpr.lib/openalpr.dll files to my CLion project. I put the header file in my project directory and included it in the source code, but I have no idea how to add the .dll or .lib files. I looked at other answers like this and this, but they are too confusing for me and I could not get mine to work; the following errors are output when I try to run:
undefined reference to `alpr::Alpr::Alpr(std::string, std::string, std::string)'
.text+0x9f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `alpr::Alpr::Alpr(std::string, std::string, st
undefined reference to `alpr::Alpr::getVersion()'
(.text+0xf3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `alpr::Alpr::getVersion()'
undefined reference to `alpr::Alpr::~Alpr()'
.text+0x123): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `alpr::Alpr::~Alpr()'
undefined reference to `alpr::Alpr::~Alpr()'
.text+0x1af): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `alpr::Alpr::~Alpr()'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/AlprCpp.dir/build.make:84: AlprCpp.exe] Error 1
make[2]: *** [CMakeFiles/Makefile2:73: CMakeFiles/AlprCpp.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/AlprCpp.dir/rule] Error 2
make: *** [Makefile:118: AlprCpp] Error 2
These are the contents of my CMake file:
cmake_minimum_required(VERSION 3.12)
project(AlprCpp)
set(CMAKE_CXX_STANDARD 14)
add_executable(AlprCpp main.cpp alpr.h)
link_directories(C:\\Projects\\AlprCpp)
find_library(AlprCpp openalpr.lib)
Thanks in advance.