Attempting to start any program in which there is an object string results in an error:

_ZNSt7_cxx1112basic_stringlcSt11char_traitslcESalcEEC1EPKcRKS3_ the procedure entry point

Even such a banal program gives an error:

#include <iostream> #include <string> using namespace std; int main() { string test; return 0; } 

Please help in solving the problem.

  • check the linker and library settings in the system ... through which IDE do you collect? - pavel
  • You probably have several gcc installed. Check which one you are referring to. - 0xdb pm
  • @ 0xdb, I really have a few gcc, thanks! - Evertum
  • @Evertum Cured? - 0xdb
  • 2
    @Evertum Strange. But the reason in my opinion is obvious - linking with one library, starting with another. Look with ldd, the paths correspond. - 0xdb

1 answer 1

There is no error in the code of the above program. You just need to add the path to the "mingw32 \ bin" folder to the PATH system variable. Or create a batch file in the project folder. For example, "D: \ tests \ env.cmd"

 PUSHD SETLOCAL SET "_MINGW=D:\MinGW\i686-6.2.0-release-posix-dwarf-rt_v5-rev0\mingw32\" SET "PATH=%_MINGW%bin;%_MINGW%opt\bin;%PATH%" cmd.exe /K ENDLOCAL POPD 

Just change the path to where you have Mingw. Run the batch file, and in the resulting window, type the command to compile. For example, your file with the code "D: \ tests \ test.cpp". Then:

 D:\tests>c++ test.cpp -o test D:\tests>test.exe 

If there are errors, then you just need to download the latest mingway. For example: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/5.3.0/threads-posix/sjlj/i686-5.3.0-release- posix-sjlj-rt_v4-rev0.7z

In the case of using any developer environment, I think this is just your case, you need to carefully check all the environment settings in the IDE options.