User forums > Help
Basic help needed with Build
Rainboy56:
I am a new user of code blocks and tried to run the simple "hello world" project. I get the following error message every time I try to build. Any help would be greatly appreciated. I am doing this in C on windows. Thanks.
-------------- Build: Debug in hello world ---------------
Compiling: main.c
Execution of 'gcc.exe -Wall -g -c "C:/cygwin/cygdrive/Hello World/main.c" -o obj/Debug/main.o' in 'C:\cygwin\cygdrive\Hello World' failed.
Nothing to be done.
JackDawson:
--- Quote from: Rainboy56 on December 05, 2011, 12:02:22 am ---I am a new user of code blocks and tried to run the simple "hello world" project. I get the following error message every time I try to build. Any help would be greatly appreciated. I am doing this in C on windows. Thanks.
-------------- Build: Debug in hello world ---------------
Compiling: main.c
Execution of 'gcc.exe -Wall -g -c "C:/cygwin/cygdrive/Hello World/main.c" -o obj/Debug/main.o' in 'C:\cygwin\cygdrive\Hello World' failed.
Nothing to be done.
--- End quote ---
From what I have experienced, Cygwin has issues with spaces. But that was my past experience with it.
Can you post your hello world code ? Because you might actually have something simple in the code that is preventing it from compiling. Also, I use the GNU GCC option ( it uses the MingW Compiler ) which compiles both C++ and C depending on how you set it up on C::B. Just letting you know that in case you didn't know. MingW comes with one of the options for the C::B download. So you have a choice to get the downloaded package with or without the MingW compiler.
Also what Windows version are you on ?
Rainboy56:
I am on Windows XP. Here is the code.
========================
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
JackDawson:
--- Quote from: Rainboy56 on December 05, 2011, 12:30:20 am ---I am on Windows XP. Here is the code.
========================
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
--- End quote ---
Ok that code is correct and in fact is the GNU GCC default C code for MingW too. This is the default that comes with Code::Blocks to begin with. So your code is obviously correct because it compiles just fine. However Cygwin, even from my past experience, just plain never worked right. Its why I moved over to MingW.
However, if your just NEEDING to stick with Cygwin, you might have to actually look at the Cygwin website to see if it has dependencies that you potentially could be missing for your Cygwin install.
The list of KNOWN compilers taken from the official Wiki for Code::Blocks is :
Supported compilers
GNU GCC (incl. G77) (Linux)
MinGW GCC (incl. G77) (Win32)
MSP430 GCC (Win32)
TriCore GCC (Win32, Linux)
PowerPC GCC (Win32, Linux)
Apple GCC (Xcode) (Mac OS X)
Microsoft Visual C++ Toolkit 2003 (Win32)
Microsoft Visual C++ 2005 (Win32)
Borland's C++ Compiler 5.5 (Win32)
DigitalMars C/C++ (Win32)
OpenWatcom (Win32)
Intel C++ compiler (Win32)
Small Device C Compiler (SDCC)
Digital Mars D
GDC D Compiler
LLVM D Compiler
Rainboy56:
Thanks for your help. I took your advice and downloaded a new copy with Mingw. I reran the program and now got a different error message using the GNU gcc option.
============
"hello world - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.
============
So I checked the settings in global compiler settings and hit auto detect but still get the same error. This is what my compiler settings show. I used default settings for the installation.
Compilers installation directory: C:\Cygwin
C Compiler: gcc.exe
Do I need to change this?
Here is the screen shot if this helps.
Navigation
[0] Message Index
[#] Next page
Go to full version