Including Header Files

Sorry to get late on this topic, but I think that it's interesting for others to have some explanations about the name mangling process and how to work with it.

Suppose you have a function : void foo (int myParam).

When you save this function in a .c file, then the function becomes available under the name foo.
When you save this function in a .cpp file, then the function becomes something like foo_@274. The "_@274" added at the end is the "name mangling". This is necessary with C++, because this language supports a specific mechanism called overriding.

You can create as many methods with the same name (foo), but with different parameters. You could have for example :
void foo (int myParam);
int foo (void);
void foo (void);
etc...

in the same program. This would be an error in C, but not in C++. The compiler identifies the correct function to call depending on the parameter used by the caller. Since the all functions have the same name, the compiler must add something to identify them, that's why the real name of the functions within the object file will be something like foo_@213 for the first one, foo_@255 for the second one, etc...

If you want to to be sure that the name is not mangled, then you have to add the following line to your .c/.cpp file
extern "C" {
void foo (int myParam)
}

This will make your function available as "foo" (not foo_something) in your object file.