Author Topic: compiler problem : no such file or directory  (Read 32096 times)

Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
compiler problem : no such file or directory
« on: April 14, 2016, 11:54:46 pm »
all dear members.
I have just installed code::blocks 16.01 in order to start learning programming. however, I have received vague problem with title no such file or directory when I tried to run Hello world example.
I also tried all ways that I found on internet but all of them were worthless.
it would be great help if someone helps me to solve this problem.
Regards.


Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler problem : no such file or directory
« Reply #2 on: April 15, 2016, 11:03:44 am »
I am running Code::Blocks version 16.01 on windows 7 SP1). The compiler I use is GCC/G++ compiler and GDB debugger from TDM-GCC version  (version 4.9.2, 32 bit, SJLJ).  It is the last version which is available on Code::Blocks's site.

When I installed this software on my PC, at first time that I wanted to run the simplest example which is existed (hello, world) in console application, it seemed that it was not able to build a model. I have received message as follow:
||=== Build: Debug in g (compiler: GNU GCC Compiler) ===|
 CreateProcess||No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Build log:
Code: [Select]
mingw32-gcc.exe -Wall -g  -c D:\Users\ART\Desktop\g\main.c -o obj\Debug\main.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))


I have already tried several ways which I found on internet.
I installed Code::Blocks 13.12, but still I had the same problem.
I also reset defaults because I saw that in some versions this could help members to solve their problems.
In addition, I tried to use another compiler; however, I was not able to download another compiler.

... but none of them worked.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2493
Re: compiler problem : no such file or directory
« Reply #3 on: April 15, 2016, 11:00:54 pm »
(To devs: If this error arises there should be a more detailed error messages, like compiler in path not found, with detailed search paths or so...)

This error can have multiple causes, but i think the main cause is that codeblocks can't find or launch the compiler.
Have you used this installer:
http://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01-setup.exe ?

if so, the compiler should be installed in the codeblocks installation folder. I can't check this at the moment, but the default installation path should be something like c:\program files (x86)\Codeblocks\MinGW
You should check if the path under "Settings->Compiler->Toolchain executables->Compiler installation directory" points to this location

you can also search for "mingw32-gcc.exe" and point the "Compiler installation directory" to the corresponding bin folder

a other cause can be that your anti virus program blocks the compiler "mingw32-gcc.exe" because it thinks that it is a virus. The solution for this would be to deactivate the anti virus, or add the compiler directory to the ignore list.

greetings

Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler problem : no such file or directory
« Reply #4 on: April 16, 2016, 12:11:37 am »
1- yes. I used this link to install codeblocks.
2- d:\program files (x86)\Codeblocks\MinGW is my installation path. I also changed my installation path to  d:\program files (x86)\Codeblocks\MinGW\bin  but codeblocks did not work again.
3- about antivirus. I tried to install codebblocks without antivirus but I did not get better result.
4- in addition, I installed codeblocks on windows xp but I got the same result.


Online stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler problem : no such file or directory
« Reply #5 on: April 16, 2016, 12:54:28 am »
Did you verify that you have a Compiler installed on your Computers?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler problem : no such file or directory
« Reply #6 on: April 16, 2016, 02:35:04 am »
in installation process codeblocks only detected one compiler which was installed by itself. I have also some other compilers such as visual c++ 2005 but it could not find it. as a result, I continued installation process only by one compiler.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler problem : no such file or directory
« Reply #7 on: April 16, 2016, 09:32:58 am »
Code: [Select]
mingw32-gcc.exe: error: CreateProcess: No such file or directory
(To devs: If this error arises there should be a more detailed error messages, like compiler in path not found, with detailed search paths or so...)

I would guess the problem is a bad Compiler Installation; but, I have never been able to find the real cause of this complaint.
The one time I had a similar issue it was caused by two MinGW installations interfering with each other.  I solved my issue my deleting all the MinGW installations (Including MSys and Cygwin) from my PATH environmental variable. I would also make sure no sh.exe commands are in the system PATH. But, the OP errors is NOT exactly like my error; so, my solution might not help them at all.

Edit: If CB could NOT find the exe the error message is different unless they changed it in the last release of 16.01

If CB could NOT find the C Compiler this is what CB Displays; note: This Forum tends to auto edit this message.
Code: [Select]
"h - Debug": The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Skipping...
"h - Debug": The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Skipping...

Tim S.
« Last Edit: April 16, 2016, 10:59:41 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2493
Re: compiler problem : no such file or directory
« Reply #8 on: April 16, 2016, 08:23:18 pm »
Code: [Select]
mingw32-gcc.exe: error: CreateProcess: No such file or directoryEdit: If CB could NOT find the exe the error message is different unless they changed it in the last release of 16.01

If CB could NOT find the C Compiler this is what CB Displays; note: This Forum tends to auto edit this message.
Code: [Select]
"h - Debug": The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Skipping...
"h - Debug": The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Skipping...

So this is a compiler internal error? probably Mingw could not find, execute something?


.
3- about antivirus. I tried to install codebblocks without antivirus but I did not get better result.
Not only deactivate during setup, but also during the use of codeblocks, or the start of compilation.

Quote
2- d:\program files (x86)\Codeblocks\MinGW is my installation path. I also changed my installation path to  d:\program files (x86)\Codeblocks\MinGW\bin  but codeblocks did not work again

Why do you have a d: in front of your path?

Can you check if your installation path of mingw is in the PATH environment variable of your os?
http://www.computerhope.com/issues/ch000549.htm

4- in addition, I installed codeblocks on windows xp but I got the same result.
Are there some similarities with your main system (for ex. same anti virus software or also does not use the c: drive ecc.)

As you can see your error is not something common, so it would be nice if you can report back what solved your issue, so you can help us and others

greetings

Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler problem : no such file or directory
« Reply #9 on: April 16, 2016, 09:42:09 pm »
today I found something interesting.
I used to installed CB on two other computers. one with windows 7 but other with windows 8. I used the same source which I used for m computer.
I got proper result and two PC were able to run CB correctly. however, it does not work on my pc. It makes me crazy.  :o :o :o :o

Online stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler problem : no such file or directory
« Reply #10 on: April 17, 2016, 12:18:54 am »
So this is a compiler internal error? probably Mingw could not find, execute something?

Yes, this is an MinGW internal error; I have only gotten it once.
But, I gotten the same error with mingw make instead of the mingw compiler about 30 times.
It has at least 50% of the time been caused by sh.exe being in my system path; the other times I saw no common cause.

Edit: My original theory related to mingw make was that it failed to find the command to delete a file; I forgot why I thought that was a possible cause.

Tim S.
« Last Edit: April 17, 2016, 12:21:25 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler problem : no such file or directory
« Reply #11 on: April 17, 2016, 01:40:37 am »

Yes, this is an MinGW internal error; I have only gotten it once.
But, I gotten the same error with mingw make instead of the mingw compiler about 30 times.
It has at least 50% of the time been caused by sh.exe being in my system path; the other times I saw no common cause.

Edit: My original theory related to mingw make was that it failed to find the command to delete a file; I forgot why I thought that was a possible cause.

Tim S.
[/quote]
I have two windows on m lab top. one of them is 7 with AVG 2014 and other XP with NOD32.
I have deleted both antiviruses. on XP I finally was successful and got result, but on 7 I still have problem.
I even have deleted all related files manually. but problem still is existed. 

Online stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler problem : no such file or directory
« Reply #12 on: April 17, 2016, 03:29:13 am »
On the Windows 7, the issue might be one of permissions.
In other words, you might try having the project you are trying to create in a folder you are positive you have read and write rights.

I would just verify the Compiler is good by compiling on the command line; but, newbies find this to be hard.
Edit: I wrote directions to verify an MinGW Compiler works somewhere; I will see if I can find them.

Tim S.
« Last Edit: April 17, 2016, 03:33:10 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler problem : no such file or directory
« Reply #13 on: April 17, 2016, 03:36:53 am »
Found my directions to verify an MinGW GCC installation; but, I have no idea if the directions are still valid.

https://github.com/stahta01/stahta01.github.io/blob/master/CodeBlocks/CB_Trouble_Shooting/CodeBlocks%20MinGW%20GCC%20Troubleshooting.txt

I would do at least part 3
Part III. Run the test batch files to confirm a good MinGW Installation

Tim S.
« Last Edit: April 17, 2016, 03:39:07 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline amiraghazadeh

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler problem : no such file or directory
« Reply #14 on: April 17, 2016, 12:58:48 pm »
Found my directions to verify an MinGW GCC installation; but, I have no idea if the directions are still valid.

https://github.com/stahta01/stahta01.github.io/blob/master/CodeBlocks/CB_Trouble_Shooting/CodeBlocks%20MinGW%20GCC%20Troubleshooting.txt

I would do at least part 3
Part III. Run the test batch files to confirm a good MinGW Installation

Tim S.
I went this way.
but similar to previous time, I got nothing.
I uninstalled and installed CB several times but I got nothing.