#include int main() { st...">

Using std :: string causes Windows to "Entry Point Not Found"

When I compile this with GCC:

#include <iostream> #include <string> int main() { std::cout << std::string("\r\n"); return 0; } 

Using the following command:

 g++ -Wall main.cc 

And try to execute the output ( a.exe ), then Windows will work with this error:

Runtime error

If I avoid using std::string in C ++ code, it runs fine, even including <string> . Any ideas?

Note the first testing of std::string .

I am running Windows 8/64 bit. My compiler includes this build-info.txt file:

 # ************************************************************************** version : MinGW-W64-builds-4.3.0 user : nixman date : 03.30.2017- 1:01:08 PM args : --mode=gcc-6.3.0 --buildroot=/c/mingw630 --jobs=2 --rev=2 --threads=win32 --exceptions=sjlj --arch=i686 --bin-compress [much more here...] # ************************************************************************** 

Update

This solved my problem.

 g++ -Wall -D_GLIBCXX_USE_CXX11_ABI=0 main.cc 

Also note that I use to disable and remove all possible anti-virus utilities (for example, Windows Defender).

+5
source share
1 answer

It was hard to find a solution (zZZzzZzZzZz), but finally it is on this answer .

 g++ -Wall -D_GLIBCXX_USE_CXX11_ABI=0 main.cc 
+1
source

Source: https://habr.com/ru/post/1268885/


All Articles