Undefined reference to process(std::__cxx11::basic_string … ) when compiling affdex linux sample applications

My initial suspicion was that the problem is attempting to compile the apps using a newer GCC or rather GLIBCXX than what the sdk is compiled with (gcc v4.8).

The error msg refers to an undefined function that the compiler is unable to find ..

undefined reference to `affdex::VideoDetector::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)

The problem here is actually the type definition of the parameter (an std::string) .. the compiler is looking for:

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >

But, the actual definition type of parameter in the compiled library is..

std::basic_string<char, std::char_traits<char>, std::allocator<char> >

As it turns out, GCC 5 introduced new implementations of std::string and std::list. You can try the workaround here to see if you can get the linking process to complete successfully, but the safest option is to fall back to using GCC 4.8.

Note, GCC 4.8 can be retrieved from ubuntu repos ..

Leave a Comment