User forums > Using Code::Blocks

Can't build or run correctly...

(1/1)

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.
--- End quote ---

(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;
}
--- End code ---

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.
--- End quote ---

Please help me, I really need help...

thomas:

--- Quote ---'C:\Documents' is not known
--- End quote ---
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.

Tenshi Akuma:
Ok, thanks! :D

Navigation

[0] Message Index

Go to full version