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

Before you run your program for hte first time, you need to build your project. Right-click the project and choose "Build Project"

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. If that still doesn't work, go to the Windows Task Manager (ctrl-alt-delete ), go to the Process tab, and look for the .exe file(s) for your program (for example, ThatsPerfect.exe). End the process(es). It should then work in Eclipse.

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,

My program will not build or run

Make sure the affected project is open, then go to Project->Preferences. Select the C/C++ Build pane, then make sure the build toolchain is using MinGW, not Cygwin.

If you still have trouble running your applications, go back to Project->Preferences and look for the run/debug pane. In that pane, edit any run configuration, and tell it to Look in Project for the binary (or find it manually if necessary).