makefile - 出错)对 std::__cxx11::basic_string 的未定义引用
问题描述
当我命令make
时,我得到了这样的错误:
filter_block.cc:(.text+0x1c4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)'
我找到了一些解决这个错误的方法,比如添加-D_GLIBCXX_USE_CXX11_ABI=0
,但我不知道如何为命令添加make
命令。
Makefile
写为:
.SUFFIXES: .c .cpp
CC = g++ -fopenmp
CFLAGS = -c -O2 -Wall -D_I386 -D_UNIX -fPIC -Wno-unused-result -std=c++11 -Wno-sign-compare
LFLAGS = -shared -O2 -o
LIBS = -llmi -lblas -lboost_regex -lpthread -lleveldb
我该如何-D_GLIBCXX_USE_CXX11_ABI=0
添加Makefile
?
*Ubuntu 版本 = 14.04
*libstdc++ 版本
$ /sbin/ldconfig -p | grep stdc++
libstdc++.so.6 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
*gcc 版本
$ gcc --version
gcc (Ubuntu 5.4.1-2ubuntu1~14.04) 5.4.1 20160904
*ld版本
$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.26.1
解决方案
推荐阅读
- java - 在 IntelliJ 中实现 TreeSet 并覆盖默认方法
- retrofit2 - RxAndroid Retrofit如何仅在第一个列表发出完成时才获取第二个列表?
- r - 在 Mac 上使用 write.table 和 file.choose 创建文件
- javascript - 我想做基本的快速路由。但它返回 -> 错误:Route.get() 需要一个回调函数但得到一个 [object Undefined]
- javascript - HMVC。谁创建子视图?
- c# - 如何链接日期和时间
- java - Spring data JPA with SQL Server - lower() 函数导致全表扫描
- javascript - 将虚拟参数发送到谷歌电子表格的 Gscript 代码
- html - HTML:喜欢需要 Windows 身份验证的资源(样式表/脚本)
- php - 如何显示与父记录相关的子记录?