The Machine is running the latest version of Windows 10.
Dev C++ 4.9.9.2 (mingw) was installed on the C: Drive (C:/Dev-Cpp) via the official bloodshed website.
The Souce Code(s) is saved in the Documents/DevC++ Folder.
When running g++ (--version) in a regular cmd, bash or powershell, there's no output, nor any error whereas gcc gives an "Internal error: Aborted (programm collect2)" error.
Well, your very first issue is that you're using Dev C++. I would recommend a better IDE like Code::Blocks or a more professional one like Visual Studio(I recommend VS), both of which you can get for free. They also give you better error messages and tell you what is wrong.
I ran the code in Visual Studio 2019 and on a few online compilers and it runs fine for me. I'm unsure what the error is.
Also, dont use system anything. use std::cin.get() to wait instead.
Something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
cout << "Running" << endl;
cin.get();
return 0;
}
It's either not installed properly or it's something weird like a bad reaction with your real-time antivirus protection (which you would need to disable if that's the case).
However, I agree that codeblocks is better than dev-c++. You might want to totally uninstall dev-c++ and get codeblocks instead.
If you must use Dev C++ there is a newer version 5.11 that would be better. Otherwise Code::Blocks or a version of MSVS, 2017 or 2019, would be a better choice. I use MSVS 2017 and 2019, but do not take that as an endorsement because I also use Code::Blocks and others at times.
Your code should not make any difference, but Dev C++ is set up to use a standard that is pre2011 so you may have some problems. Or as dutch said it may have been a bad install.
If it is properly installed consider following this:
The DEV C++ that I have is version 5.11 with a build year of 2015.
To adjust the settings:
• Under the Tools menu choose "Compiler Options".
• In the window that comes up you will see tabs for "General", "Settings", "Directories" and "Programs".
• Choose the settings tab.
• In the next set of tabs that come up choose "Code Generation".
• The last line should say “Language Standard (-std).
• On the right side of that line click on the down arrow.
• In the list box that comes up choose "ISO C++ 11". // I believe this is the best choice.
• Press "OK".
This will let the IDE and compiler use the C++11 standards.
You should also look under the “Help” menu choice and click on "About" for more information.
Just so you know I ran this in my installed version of Dev C++ wit no problem.
You posted the contents of the log file, but the "Makefile.win" file would be of more use.
Installing a newer (5.11) seems to have fixed the issue magically.
It is worth noting that the newer version were (auto)installed into the Program Files(x86) folder instead of directly on the C: drive. Furthermore TDM was chosen.