/ usr / bin / ld:找不到-lc ++ [英] /usr/bin/ld: cannot find -lc++

查看:225
本文介绍了/ usr / bin / ld:找不到-lc ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在跟踪有关在当到达执行sh build.sh的步骤时,出现找不到-lc ++ 错误。

I am following a tutorial on building an audio classifier here and when reach to the step where I run the sh build.sh I get the cannot find -lc++ error.

请注意,任何

Building standalone classifier
mkdir -p build
rm -rf *.gcda
rm -rf *.gcno
clang -c -DTF_LITE_DISABLE_X86_NEON -Wall -I. -Isource -Iedge-impulse-sdk/ -Iedge-impulse-sdk/tensorflow -Iedge-impulse-sdk/third_party -Iedge-impulse-sdk/third_party/flatbuffers -Iedge-impulse-sdk/third_party/flatbuffers/include -Iedge-impulse-sdk/third_party/flatbuffers/include/flatbuffers -Iedge-impulse-sdk/third_party/gemmlowp/ -Iedge-impulse-sdk/third_party/gemmlowp/fixedpoint -Iedge-impulse-sdk/third_party/gemmlowp/internal -Iedge-impulse-sdk/third_party/ruy -Imodel-parameters -Itflite-model -Iedge-impulse-sdk/anomaly -Iedge-impulse-sdk/classifier -Iedge-impulse-sdk/dsp -Iedge-impulse-sdk/dsp/kissfft -Iedge-impulse-sdk/porting -lc++ -lm  edge-impulse-sdk/tensorflow/lite/c/common.c -o build/common.o
clang: warning: -lc++: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
clang++ -DTF_LITE_DISABLE_X86_NEON -std=c++11 -Wall -I. -Isource -Iedge-impulse-sdk/ -Iedge-impulse-sdk/tensorflow -Iedge-impulse-sdk/third_party -Iedge-impulse-sdk/third_party/flatbuffers -Iedge-impulse-sdk/third_party/flatbuffers/include -Iedge-impulse-sdk/third_party/flatbuffers/include/flatbuffers -Iedge-impulse-sdk/third_party/gemmlowp/ -Iedge-impulse-sdk/third_party/gemmlowp/fixedpoint -Iedge-impulse-sdk/third_party/gemmlowp/internal -Iedge-impulse-sdk/third_party/ruy -Imodel-parameters -Itflite-model -Iedge-impulse-sdk/anomaly -Iedge-impulse-sdk/classifier -Iedge-impulse-sdk/dsp -Iedge-impulse-sdk/dsp/kissfft -Iedge-impulse-sdk/porting -lc++ -lm  source/*.cpp edge-impulse-sdk/dsp/kissfft/*.cpp edge-impulse-sdk/dsp/dct/*.cpp edge-impulse-sdk/tensorflow/lite/kernels/*.cc edge-impulse-sdk/tensorflow/lite/kernels/internal/*.cc edge-impulse-sdk/tensorflow/lite/micro/kernels/*.cc edge-impulse-sdk/tensorflow/lite/micro/*.cc edge-impulse-sdk/tensorflow/lite/micro/memory_planner/*.cc edge-impulse-sdk/tensorflow/lite/core/api/*.cc ./edge-impulse-sdk/dsp/memory.cpp edge-impulse-sdk/porting/posix/*.c* build/common.o -o build/edge-impulse-standalone
/usr/bin/ld: cannot find -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile.tflite:36: recipe for target 'build' failed
make: *** [build] Error 1


推荐答案

替换 clang clang ++ g ++ 表示。然后 -lc ++ 变为自动

Replace clang by clang++ or g++. Then -lc++ becomes "automagically" linked.

当然,花几天时间阅读 GCC的文档 C语(以及 ld binutils ;因为 clang ++ g ++ 正在运行 ld )。请仔细阅读有关调用GCC 的信息。 g ++ (以及 clang ++ )的程序参数顺序很重要。

Of course, spend a few days reading the documentation of GCC and of Clang (and of ld from binutils; since both clang++ and g++ are running ld). Read carefully about invoking GCC. The order of program arguments to g++ (and also to clang++) are important.

由于您使用的是 GNU make ,因此您显然需要花一天的时间阅读其文档

Since you use GNU make, you obviously need to spend a day reading its documentation.

PS。预算一下阅读文档的一周工作。

PS. Budget perhaps a week of work in reading documentation.

这篇关于/ usr / bin / ld:找不到-lc ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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