I need to integrate OpenALPR library into my c++ program. Unfortunaltely, I can't make linking work.
openalpr.lib is in C:\path\to\alpr , alpr.h header in C:\path\to\alpr\include all *.dll files are in catalog with main file. System Windows7, Compiler Gcc 5.3.
Current build command:
g++ -Wall -fexceptions -g -IC:\path\to\alpr\include -c C:\path\to\project\main.cpp -o obj\main.o
g++ -LC:\path\to\alpr -o bin\test.exe obj\main.o -lopenalpr
code:
#include <alpr.h>
int main()
{
alpr::Alpr openalpr("us", "openalpr.conf");
return 0;
}
error:
undefined reference to `alpr::Alpr::Alpr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
And so on, and so on, plenty of similar 'undefined references'.
OpenALPR library is downloaded in binary version from: https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(Windows)
Am I supposed to build library from sources? Maybe I missed something? Thanks in advance.
GCC5 and the C++11 ABI:
Try compiling with
-D_GLIBCXX_USE_CXX11_ABI=0
.