multi-file project

How am I supposed to properly set up a multi-file project in the ide (without creating a new library, if possible). I.e. I have the standard .pde file but I also want to use functions, etc. separated out in some other (C or C++) files. I can include the headers all right but cannot come to compile the code with other files.

For the sake of simplicity I have three files in the same directory (..../main):
main.pde which is as follows

#include "fruit.h"

void setup()
{
apple = peach();
}

void loop()
{
Serial.println(apple);
}

then I have fruit.h as follows:

int apple;
int peach();

and lastly fruit.c:

#include "fruit.h"

int peach()
{
return 5;
}

When I try to "Verify" the main.pde file in the IDE it gives me an "In function 'setup()': Undefined reference to peach()" error...

What do I do wrong?

The main sketch file (the .pde) is compiled as C++. To use C functions from C++, you need to wrap their declarations (in the header file) in an extern "C" {} block.

For example (although I'm doing this from memory):

#ifdef __cplusplus
extern "C" {
#endif

int apple;
int peach();

#ifdef __cplusplus
}
#endif

Thanks, works just perfect.