问题
I have searched all over and cannot find a solution.
I installed the code::blocks version with the compiler. (Windows 7) Every time I try to compile, I get the No Such file or directory error. I thought maybe the spaces were causing the problem, so I downloaded and installed ming alone to C:\GCC\MinGW-w64
I went into the compiler settings/toolchain executables and directed every path so it wouldn't try to read from the Program Files one where code::blocks is installed. Same error occurred. I've also tried going directly to the bin folder.
I've reset to default settings. I've auto-detected. I've uninstalled and reinstalled. I've seriously tried about everything.
Then I thought maybe because it's where I'm saving my projects, since they have spaces. So I put them directly to the c:\ drive. Same error.
This worked the first day I used it, after that it's been this problem ever since. So you'd think reinstalling everything would fix it right?
If anyone has a solution please do tell! Using the exact same installation file on another computer, the compiler works fine, every setting is exactly the same as it is on this one, except on the other one it works.
Here's the error messages. I made a quick console project just to post these errors.
||=== Build: Debug in hhhh (compiler: GNU GCC Compiler) ===|
CreateProcess||No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
mingw32-g++.exe -Wall -fexceptions -g -c C:\Users\Mack\hhhh\main.cpp -o obj\Debug\main.o
mingw32-g++.exe: error: CreateProcess: No such file or directory
Yet every time I go into the toolchain and redo the paths, they are all correct. The files are there, but code::blocks for some reason is not seeing them.
Before coming here, I tried to make an account on the code::blocks forum, but it's broken. Activation email won't send and I can't find any email address to contact support. I've tried registering with a live.com, gmail.com, and mail.com email accounts, and none of them received the activation email.
Also here is the simple Hello World I used that gave me the above errors.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
Here are some screenshots.
Default settings. http://prntscr.com/9eyoi4
Redirected to the latest compiler install. Redid each path so they all direct to the new files. http://prntscr.com/9eyqnx
回答1:
Windows 7 can be particular about where it will allow you to write files. The directory where you installed Code::Blocks itself shouldn't matter as it doesn't write back to it's installation folder, but just in case, I installed mine in C:\Develop\CodeBlocks. Windows 7 will not allow software to write to the program files folder once installed there. Like I said, probably not an issue, but just in case, you may want to move it outside of that location, something like what I have. I also have MinGW 4.8.1 installed it it's own folder in C. I put it in C:\MinGW and pointed to it as you did. Code::Blocks has no problem autodetecting it though.
For my projects, I put mine in my C:\Develop\Projects folder. I am not sure if Windows 7 will allow software to write to your home folder, at least I don't think it's a location that is recommended by Microsoft. If you prefer a location in there, your Documents folder is a safe location to create projects and can be written to. My suspicion is that a file is not getting written at compile time and then, of course, it is not being found and so you get that error.
Incidentally, I am also using Windows 7 (64bit) with Code::Blocks v13:12 and MinGW 4.8.1 (32bit version).
回答2:
AntiVirus false triggers? Or Windows Defender etc, if the behaviour change was noticed after a system update.
I have C::B 16.01
, but installed well away from C:\Program files
etc, on Win7(64) and (once I figured out how to point it at some needed third party lib's) it all works fine. So far...
Regards.
DJB.
来源:https://stackoverflow.com/questions/34319405/mingw32-g-exe-error-createprocess-no-such-file-or-directory-again