在动态链接库中找不到过程入口点_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev [英] The procedure entry point _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev could not be located in the dynamic link library

查看:45
本文介绍了在动态链接库中找不到过程入口点_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在尝试将字符串存储在变量中.我在网上做了很多搜索,我找到的大多数答案都推荐使用 std::string.所以我写了一个看起来像这样的测试程序:

Lately I have been trying to store strings in variables. I did quite a few searches online, and most of the answers that I have found recommend the use of std::string. So I've written a test program that looks like this:

#include <iostream>
#include <string>
using namespace std;

int main(){
    string s;
    getline(cin,s);
    cout << s;
}

程序编译正常,但是,当我运行程序时,我再次出现此错误:`错误留言

The program compiles fine, however, when I run the program I revieve this error:`Error Message

我是一个巨大的编程初学者,对正在发生的事情感到困惑.任何人都可以让我对这里发生的事情有所了解吗?谢谢!

I am a huge beginner to programming and confused on what is going on. Can anyone please give me some insight on what is happening here? Thanks!

另外,我使用的是 GCC 编译器.

Also, I am using the GCC compiler.

我已经成功解决了这个问题.我所做的只是使用网上的教程重新安装 GCC.我不知道出了什么问题,但现在已经修复了.

I have successfully solved the issue. All I did was reinstall GCC using a tutorial on the web. I do not know what was wrong, but it is fixed now.

推荐答案

当你使用GCC编译C++时,需要使用g++驱动程序,而不是gcc.后者将编译翻译单元,但不会正确链接可执行文件.

When you use GCC to compile C++, you need to use the g++ driver program, not gcc. The latter will compile the translation units, but it will not link the executable correctly.

这篇关于在动态链接库中找不到过程入口点_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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