问题
When I compile this with G.C.C.:
#include <iostream>
#include <string>
int main()
{
std::cout << std::string("\r\n");
return 0;
}
By using the following batch:
g++ -Wall main.cc
And attempt executing the output (a.exe
), then Windows crashes the initialization with this error:
If I avoid using std::string
in the C++ code it executes normally, even including <string>
. Any ideas?
Note, first time testing std::string
.
I run Windows 8 / 64 bits. My compiler includes this file build-info.txt
:
# **************************************************************************
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...]
# **************************************************************************
Also note that I'm used to disable and uninstall all possible anti-virus utilities (e.g., Windows Defender).
回答1:
It was hard to find a solution (zZZzzZzZzZz), but finally, it's on this answer.
g++ -Wall -D_GLIBCXX_USE_CXX11_ABI=0 main.cc
来源:https://stackoverflow.com/questions/44573802/using-stdstring-causes-windows-entry-point-not-found