make: Nothing to be done for ‘all’ – Eclipse Error Solved

I’ve seen this odd error several times over the years, almost always after first importing a new project into Eclipse-CDT.

After import, when you try to build your project, it just returns the message make: Nothing to be done for all in the console.

And then, once you’ve got the error, nothing you do will kick your build into action – changing files, changing project settings, even deleting and recreating build configurations.

If you try to run the executable, you just get Launch failed. Binary not found.

Because, of course, make hasn’t built anything.

Aargh!

Annoying, eh?

Read moremake: Nothing to be done for ‘all’ – Eclipse Error Solved

Eclipse-CDT: Base class ” not in include paths for current project

eclipseDon’t you just hate weird things like this? You have a nice little project in Eclipse, it’s all is working fine, auto-complete, build, everything.

BUT:

When you try to add a new class using the File -> New -> Class menu, you get this error:

Base class 'myclassname' not in include paths for current project.

Doh!

This one is easy to fix.

Read moreEclipse-CDT: Base class ” not in include paths for current project

Eclipse CDT + GDB: Setting Watchpoints (Juno)

I was trying to watch a variable in Eclipse today and just could not find how to set it up. No matter what I did the Toggle Watchpoint option remained greyed out.

A watchpoint is more fun than a regular breakpoint, because the debugger will stop whenever the variable is changed, even if your program is busy doing something else (like overrunning the end of an array).

So after a bit of research it turns out that you can set watchpoints, but the variable type dictates how.

Global variables

If your variable is global, you need to double-click the variable to highlight it (anywhere in your source) and then select Run > Toggle Watchpoint. Until your variable is selected, this option will always be greyed out.

You can also right click on it in the Outline View and then select Toggle Watchpoint from the context menu.

In both cases a watchpoint properties box pops up so you can edit the details. Just click OK and the debugger will stop every time the variable is changed.

If the variable is not listed in the Outline View then sorry – it’s not global and you can’t use the Eclipse GUI to set it – but you can do this:

Local variables

When you’re debugging with gdb via Eclipse, there is a sneaky gdb console view that you can use to talk directly to the gdb session.

Select the console tab at the bottom and on the right-hand side click the Display Selected Console button. This will reveal a drop down menu. Choose [C/C++ Application] gdb.

And now, in the console itself, just type your watchpoint as if you were on the gdb command line (in the screenshot below I want to be notified if a local variable called count goes above the value of 45):

 

gdb console watchpoint

Ta da! Eclipse will now stop whenever your local variable changes.