简体   繁体   中英

unable to compile program on dev-c++?

Downloading the new version fixed my problem thanks for the help.

I can't compile my program and I have no idea why? I have searched quite hard to find any reason why this is happening with no results. I am just trying to run the default example that dev-c++ gives you this is what it spits out This is the compile log

Compiler: Default compiler
Building Makefile: "C:\Users\alex\Desktop\C++\test2\Makefile.win"
Executing  make...
make.exe -f "C:\Users\alex\Desktop\C++\test2\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   

make.exe: *** [main.o] Error -1073741819

Execution terminated

I translated -1073741819 to hexadecimal number (using Windows calculator):

-1073741819 = 0xC0000005

There is a table of all NTSTATUS Values on MSDN. The relevant row:

0xC0000005 STATUS_ACCESS_VIOLATION

The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

This sounds like OP's g++ is somehow broken as it looks for me that make.exe reports the exit code -1073741819 of g++ .

In my 20 years professional experience, I had some rare cases where certain specific wrong C++ code made my compiler crashing (instead of just reporting an error). It did not happen for years anymore.

The OP's sample code

#include <cstdlib>
#include <iostream>

using namespace std;

int name(int argc, char *argv[])
{
  system("PAUSE");
  return EXIT_SUCCESS;
}

looks IMHO much too innocent to cause such a compiler bug like mentioned above.

So, I agree with the advice of Yunnosch:

Try g++ --version on console (eg cmd.exe ). a) Check of g++ is runnable at all. b) Have a look whether the version is not too outdated.

You may check also whether concurrent installations of tools with equal name are accidentally mixed somehow. This may happen eg by having conflicting locations in the PATH environment variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM