News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Can't build or run correctly...

Started by Tenshi Akuma, December 07, 2007, 03:24:08 PM

Previous topic - Next topic

Tenshi Akuma

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:

#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):

QuoteExecution 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...

thomas

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