看错误内容:

/data/projects/LipReadingSDKGPU/lib/cwlibs/libLipReading.so: undefined reference to `tensorflow::Status::ToString[abi:cxx11]() const'
/data/projects/LipReadingSDKGPU/lib/cwlibs/libLipReading.so: undefined reference to `tensorflow::ReadBinaryProto(tensorflow::Env*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::MessageLite*)'
/data/projects/LipReadingSDKGPU/lib/cwlibs/libLipReading.so: undefined reference to `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]'
/data/projects/LipReadingSDKGPU/lib/cwlibs/libLipReading.so: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'
/data/projects/LipReadingSDKGPU/lib/cwlibs/libLipReading.so: undefined reference to `tensorflow::strings::StrCat[abi:cxx11](tensorflow::strings::AlphaNum const&)'

stackoverflow上一个友人的解释:

I suspect this is a C++ ABI issue. The ABI for std::string has changed in GCC  (related to C++ requirements, but it applies even if you aren't using C++11). See:
https://gcc.gnu.org/gcc-5/changes.html#libstdcxx If libprotobuf was built with GCC .x or prior, but your app is built with GCC , then you will see problems, because libprotobuf uses std::string in its interface. You have two options: .Rebuild libprotobuf with GCC (but now any apps built with GCC won't work with the new version of libprotobuf).
.Build you app with -D_GLIBCXX_USE_CXX11_ABI= as described at the above link. This will force GCC to use the old ABI version.

这个错误是在我把gcc4.8编的工程迁移到ubuntu16.04(gcc5.4)上编译时候发生的。这是C++ ABI一个错误,gcc4升gcc5时,std::string库接口做了迁移,而我工程中用了三方库tensorflow和protobuf,protobuf中用到了std::string。已经编好的tensorflow是用gcc4.8编的,gcc5上链接,接口对不上。两种解决方案:一种用gcc5重新编译三方库和工程,另一种就是在工程的编译选项(而不是链接选项)上加上-D_GLIBCXX_USE_CXX11_ABI=0参数,强制使用旧接口,问题解决。

更详细的解释可以参考:http://www.itkeyword.com/doc/8367047421581508x309/linking-problems-due-to-symbols-with-abicxx11

c++ - Linking problems due to symbols with abi::cxx11?的更多相关文章

  1. Xcode Build Setting Reference

    https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/ ...

  2. Extremely fast hash algorithm-xxHash

    xxHash - Extremely fast hash algorithm xxHash is an Extremely fast Hash algorithm, running at RAM sp ...

  3. Java多线程系列--“JUC集合”10之 ConcurrentLinkedQueue

    概要 本章对Java.util.concurrent包中的ConcurrentHashMap类进行详细的介绍.内容包括:ConcurrentLinkedQueue介绍ConcurrentLinkedQ ...

  4. [Artoolkit] Can I Use LGPL code for commercial application

    这是一个比较普遍但又容易被忽略的问题. From: http://answers.google.com/answers/threadview/id/439136.html 假设背景: - want t ...

  5. c malloc分配内存

    php中的内存分配有用类似emalloc这样的函数,emalloc实际上是C语言中的malloc的一层封装,php启动后,会向OS申请一块内存,可以理解为内存池,以后的php分配内存都是在这块内存池中 ...

  6. OPENVPN2.3配置文档官方说明

    openvpn Section: Maintenance Commands (8)Index NAME openvpn - secure IP tunnel daemon. SYNOPSIS open ...

  7. malloc.c

    glibc-2.14中的malloc.c源代码,供研究malloc和free实现使用: /* Malloc implementation for multiple threads without lo ...

  8. gcc6.3编译c++11的程序链接opencv时字符型函数未定义

    在Windows下编写图像处理程序,由于要使用regex,升级了mingw,编译c++11代码.之前代码中使用了opencv2.4.10,一直运行良好,升级编译器以后发现了错误:undefined r ...

  9. J.U.C并发框架源码阅读(十)ConcurrentLinkedQueue

    基于版本jdk1.7.0_80 java.util.concurrent.ConcurrentLinkedQueue 代码如下 /* * ORACLE PROPRIETARY/CONFIDENTIAL ...

随机推荐

  1. [记录] Linux Apache隐藏index.php

    1. 在项目更目录下新建 .htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEng ...

  2. Django 之单个mysql表使用

    1. mysql 表使用的功能有: 增 删  改 查  这几大功能, 但是mysql 和django 对接之后,使用的语法不是原生的SQL语法. 2. 增功能的实现: User.objects.cre ...

  3. Oracle 学习总结 - 表和索引的性能优化

    表的性能 表的性能取决于创建表之前所应用的数据库特性,数据库->表空间->表,创建数据库时确保为每个用户创建一个默认的永久表空间和临时表空间并使用本地管理,创建表空间设为本地管理并且自动段 ...

  4. ubuntu卸载福昕阅读器

    在安装目录找到maintenancetool.sh运行之 ~/opt/foxitsoftware/foxitreader

  5. python正则表达式查找汉字

    使用正则表达是查找汉字之前,要将所有的字符串都转码成utf8 import re string_test = "This is test string 这是测试字符串" strin ...

  6. linux /dev/null 中有数据

    前段时间有个同事问我说,他 cat /dev/null有数据.这个颠覆大家认知的问题最终却是个小问题. 我们来看/dev/null的操作函数: static const struct memdev { ...

  7. ASP.NET HTTP 协议

    http是无状态的,不会记得“上个请求***”,所以哪怕是同一个页面中的js.css.jpg也都要重复的提交Accept-Language.Accept-Encoding.Cookie等. 一般情况下 ...

  8. python实现根据指定字符截取对应的行的内容

    工作中遇到的,在一个.c文件中有很多函数,这个.c是自动生成的,需要将所有的函数通过extern放到.h中,每个函数都是UINT32 O_开头,通过正则表达式进行字符匹配以及通过linecache来截 ...

  9. [C语言]变量VS常量

    -------------------------------------------------------------------------------------------- 1. 固定不变 ...

  10. C#调用Delphi接口(ITest = interface)

    首先创建一个delphi的DLL工程 library testintfdll; { Important note about DLL memory management: ShareMem must ...