Author Topic: Can't build or run correctly...  (Read 2599 times)

Tenshi Akuma

  • Guest
Can't build or run correctly...
« on: December 07, 2007, 03:24:08 pm »
Ok, so I use Win2000.

I made a C console project, but everytime I try running/building(or both), it shows this:



Then, if I open it without building, it says:

Quote
'C:\Documents' is not known as an intern(inside) or extern(outside) command, an unexecutable program or a command files.

Press Enter to continue.

(I've translated from french, for my cpu language is french :P, so it might no be very... easy to understand..)

The only thing is this is my code:

Code
#include <stdio.h>
#include <stdlib.h>

int main()
{
printf("Bonjour\n");

             system("PAUSE");
return 0;
}

So, it's supposed to show "Bonjour"(which means "Hi"), skip a line and then I should press enter to close it, but the message is not shown. It is supposed to be due to the fact that I can't build main.c before running it, but... why can't I build it?

When I try building it, it shows exactly this( in the Build log, at the bottom):

Quote
Execution of 'mingw32-gcc.exe    -O -Wmain -pedantic-error -pedantic -w -W -Wall -g    -c main.c -o .objs\main.o' in 'C:\Documents and Settings\All Users.WINNT\Menu Démarrer\Programmes\CodeBlocks' failed.

Please help me, I really need help...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't build or run correctly...
« Reply #1 on: December 07, 2007, 04:21:34 pm »
Quote
'C:\Documents' is not known
This looks like two things happen here:
1. you have your compiler installed under C:\Documents and Settings\Someotherpath
2. you use a very old version of Code::Blocks (more than 2 years old)

A path containing spaces (such as in Documents and Settings) must be properly quoted. Very old versions of Code::Blocks did not do that correctly. The result was that the operating system thought it should run a program Documents with the parameters and and Settings/Someotherpath - which obviously fails.

Solution: use a recent version, or do not use pathnames that contain spaces.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Tenshi Akuma

  • Guest
Re: Can't build or run correctly...
« Reply #2 on: December 07, 2007, 04:55:24 pm »
Ok, thanks! :D