简体   繁体   English

编译 C++ 程序的问题

[英]Problems with Compiling a C++ program

I am trying to compile a simple Hello World C++ program on my new Conda environment, but it returns a exit status as shown below.我正在尝试在我的新 Conda 环境中编译一个简单的 Hello World C++ 程序,但它返回一个退出状态,如下所示。

/home/ep/anaconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status

g++ is also installed, and libstdc++.so is also found in lib director of anaconda3. g++也安装好了,在anaconda3的lib目录下也找到了libstdc++.so。

g++ (crosstool-NG 1.24.0.131_87df0e6_dirty) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Could anyone suggest to me how to solve this issue?谁能建议我如何解决这个问题?

You need also install the development files of library libstdc++您还需要安装库libstdc++的开发文件

Eg In you are in Debian/Ubuntu例如,你在 Debian/Ubuntu

sudo apt install libstdc++-8-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM