对编译affdex linux示例应用程序时未定义的对进程的引用(std :: __ cxx11 :: basic_string ...) [英] Undefined reference to process(std::__cxx11::basic_string ... ) when compiling affdex linux sample applications

查看:6899
本文介绍了对编译affdex linux示例应用程序时未定义的对进程的引用(std :: __ cxx11 :: basic_string ...)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编译 affdex sdk示例应用程序时遇到以下错误



I encountered the following error when I tried to compile affdex sdk sample applications

Linking CXX executable video-demo
CMakeFiles/video-demo.dir/video-demo.cpp.o: In function 'main':
video-demo.cpp:(.text+0x11cb): undefined reference to 
affdex::VideoDetector::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
collect2: error: ld returned 1 exit status

$ b b

我正在使用GCC 5.2.1

I'm using GCC 5.2.1

推荐答案

我最初的怀疑是,使用更新的GCC或GLIBCXX编译应用程序,而不是编译sdk(gcc v4.8)。

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

错误msg指的是一个未定义的函数,编译器无法找到..

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

这里的问题其实是参数的类型定义(std :: string) ..编译器正在寻找:

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

结果是,GCC 5引入了 std :: string和std :: list 的新实现。您可以尝试解决方法此处,查看您是否可以成功完成关联过程,但最安全的选择是回退到使用GCC 4.8。

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.

注意,GCC 4.8可以从ubuntu repos检索。

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

这篇关于对编译affdex linux示例应用程序时未定义的对进程的引用(std :: __ cxx11 :: basic_string ...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆