News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

gcc compiler can't make obj file for c file

Started by outsky, August 23, 2008, 07:37:23 AM

Previous topic - Next topic

outsky

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 .

ironhead

What happens if you execute the mingw32-gcc command from a command prompt?

yis

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.

rcoll

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

yis

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?

MortenMacFly

Quote from: yis on September 01, 2008, 08:18:19 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

yis

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

outsky

thanks for reply, I installed it again,I set the environment variable correctly,It works well now