Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using std::string causes Windows "Entry Point Not Found" [duplicate]

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:

Run time 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).

like image 922
Klaider Avatar asked Jun 15 '17 17:06

Klaider


1 Answers

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
like image 182
Klaider Avatar answered Sep 28 '22 07:09

Klaider