Code::Blocks Forums

User forums => Help => Topic started by: outsky on August 23, 2008, 07:37:23 am

Title: gcc compiler can't make obj file for c file
Post by: outsky on August 23, 2008, 07:37:23 am
Hi,
I am fresh with code blocks.And I met some obvious problems,
here shows the message.How to make it right?
 /*the source file*/
 #include <stdio.h>
int main (void)
{
    int a=10;
    int b=20;
    printf("%hd + %hd = %hd",a,b,a+b);
    return 0;
    }
And the problem is,
Compiling: Untitled1.c
Execution of 'mingw32-gcc.exe -Wall  -g    -I"C:\Program Files\CodeBlocks\MinGW\bin"  -c C:\mingw\CodeBlocks\MinGW\bin\test\Untitled1.c -o obj\Debug\Untitled1.o' in 'C:\mingw\CodeBlocks\MinGW\bin\test' failed.
Nothing to be done.

could you please tell me why it failed ? I would appreciate it very much if anser me .
Title: Re: gcc compiler can't make obj file for c file
Post by: ironhead on August 23, 2008, 03:18:56 pm
What happens if you execute the mingw32-gcc command from a command prompt?
Title: Re: gcc compiler can't make obj file for c file
Post by: yis on August 31, 2008, 10:40:23 am
ironhead,

I'm having a similar problem as outsky, but being a newbie maybe you could be more explicit as to how to solve this problem.
Title: Re: gcc compiler can't make obj file for c file
Post by: rcoll on August 31, 2008, 12:15:59 pm
First question:  are you using Vista?  If so, take everything out of "C:\Program Files\*" and put it into a directory that has no spaces in the name.

Second:  is your project really in the "\bin" directory?  Take it out of there; make a directory such as "C:\MyWork" and put the source files in there.  The "\bin" directory is for compiler files.

Third:  that option -I"C:\Program Files\CodeBlocks\MinGW\bin" should probably be -I"C:\Program Files\CodeBlocks\MinGW\bin\test" (or C:\MyWork when you move the source files over).

Basically the message "Nothing to be done." means the compiler could not find your files to compile.

Ringo
Title: Re: gcc compiler can't make obj file for c file
Post by: yis on September 01, 2008, 08:18:19 am
Thanks for responding,

perhaps I wasn't specific enough. I am using windows XP. Here is exactly what I get when I run 'build' to compile.

Compiling: C:\Documents and Settings\ys\Start Menu\Programs\CodeBlocks\whatever.c
Execution of 'mingw32-g++.exe    -c "C:\Documents and Settings\יys\Start Menu\Programs\CodeBlocks\whatever.c" -o "C:\Documents and Settings\ys\Start Menu\Programs\CodeBlocks\whatever.o"' in 'C:\Documents and Settings\ys\Start Menu\Programs\CodeBlocks' failed.
Nothing to be done.

What am I doing wrong?
Title: Re: gcc compiler can't make obj file for c file
Post by: MortenMacFly on September 01, 2008, 01:20:01 pm
What am I doing wrong?
Probably you should first install/configure a compiler. Try the C::B 08/02 release "bundle" installer that ships with the MinGW compiler suite and configures C::B just right for you.
Title: Re: gcc compiler can't make obj file for c file
Post by: yis on September 01, 2008, 05:47:29 pm
"Probably you should first install/configure a compiler. Try the C::B 08/02 release "bundle" installer that ships with the MinGW compiler suite and configures C::B just right for you."[/i]

That is exactly what I did in the first place.
Title: Re: gcc compiler can't make obj file for c file
Post by: outsky on November 14, 2008, 04:51:46 pm
thanks for reply, I installed it again,I set the environment variable correctly,It works well now