Author Topic: gcc compiler can't make obj file for c file  (Read 4366 times)

Offline outsky

  • Single posting newcomer
  • *
  • Posts: 3
gcc compiler can't make obj file for c file
« 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 .

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: gcc compiler can't make obj file for c file
« Reply #1 on: August 23, 2008, 03:18:56 pm »
What happens if you execute the mingw32-gcc command from a command prompt?

Offline yis

  • Single posting newcomer
  • *
  • Posts: 3
Re: gcc compiler can't make obj file for c file
« Reply #2 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.

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: gcc compiler can't make obj file for c file
« Reply #3 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

Offline yis

  • Single posting newcomer
  • *
  • Posts: 3
Re: gcc compiler can't make obj file for c file
« Reply #4 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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9604
Re: gcc compiler can't make obj file for c file
« Reply #5 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline yis

  • Single posting newcomer
  • *
  • Posts: 3
Re: gcc compiler can't make obj file for c file
« Reply #6 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.

Offline outsky

  • Single posting newcomer
  • *
  • Posts: 3
Re: gcc compiler can't make obj file for c file
« Reply #7 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