Click here to Skip to main content
15,891,993 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to run the following code

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

class DivyasClass{
    public:
        string name;
};

int main()
{
    DivyasClass dobj;
    dobj.name = "Divya Sharma";
    cout << dobj.name;
    return 0;
}


I've tried running it using both Code::Blocks as well as the command line, but it gives the following error message:

The procedure entry point _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev could not be located in the dynamic link library

What I have tried:

I found a similar question online, but the solution was to use the g++ compiler. My code::blocks is already using the g++ compiler and through the command line I compiled the program using the g++ compiler as well. So I don't know what to do next. Please help!
Posted
Updated 7-Jul-17 21:54pm
Comments

1 solution

Your code is fine, you can test that online: Free Online IDE and Terminal[^]
So I would look at your configuration or maybe reinstall Code::Blocks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900