Common Problems with C in Eclipse

Listed below are some common problems CSSE 120 students have when installing the CDT development environment for Eclipse. If you find out about any other issues, let us know and we can add them to this page.

GCC won't run

Verify that you set the Windows PATH correctly by opening a Windows command prompt (Start --> Run --> cmd) and entering:

gcc

You should get the message "gcc: no input files". If instead you get "'gcc' is not recognized as an internal or external command, operable program or batch file", then you need to carefully follow the MinGW installation instructions again.

No binaries

You might be trying to run your program before saving it. Save the file and try again.

Because C compiles your program, you cannot run it if it has any errors remaining. You have to fix all errors (or comment them out) before running.

You must name your source file with a ".c" (lowercase) extension. Otherwise the compiler will ignore it. Rename your source file if it is named wrong.

Permission denied, unable to write to ProjectName.exe

Windows is running your program and can't change the running version. Kill the running ProjectName.exe program using Task Manager or by using the "Display Selected Console" button in the top edge of the Eclipse Console view. This button looks like a little computer monitor. Switch to the ProjectName.exe console, then click the Terminate button. You might have to do this multiple times if multiple copies are running. Next, force Eclipse to re-compile the project. You can do this using the Project --> Clean menu item.

C programs won't compile in Eclipse on Vista

There's no known solution for this one. If you find one, let us know!.

An old version of my program runs instead of the one with my changes.

See No binaries and Permission denied, unable to write to ProjectName.exe.

"No rule to 'make all'"

This happens when you choose the wrong project type. For CSSE120 we will typically use Executable > Hello World ANSI C projects. Try creating a new project of this type and copying your code into the new project.

"My debugger doesn't work!"

This is due to an Eclipse 3.4 bug. One solution that will let it run is to move your C Eclipse Workspace to a location that has no spaces in the name, like "C:\CWorkspace". Known issue: output does not go to the console (or to a black DOS window) when you debug, so you will have to view the variables from within the debugger,