separating files for classes and thier implemenation.

This is a discussion on separating files for classes and thier implemenation. within the C++ Programming forums, part of the General Programming Boards category; Hello,
I have a class that I have written. But have a problem with a compile error. Underfined reference to ...

I believe inline functions are treated differently by the compiler, and also inlining is purely up to the compiler anyway. Just because you use the 'inline' keyword doesn't necessarily mean it will be inlined.
Please do not quote me on that, as that information may be inaccurate.(AFAIK basically)

True, but the compiler cannot inline function no matter what if the caller and callee are in different files (as in separately compiled).

That is why, for example, in chess engines, which are mostly CPU-bound, people try to squeeze out the last bit of performance by not using headers at all - and have the main file include all other cpp files. That way the compiler can optimize across the whole program (inlining functions for example).

well, for a typical program running on modern hardware, about 2,000,000 positions can be searched per second. For every position, there needs to be two calls to the "inCheck()" function, which is just a few lines (so the call overhead is comparatively big).

True, but the compiler cannot inline function no matter what if the caller and callee are in different files (as in separately compiled).

Untrue. The compiler, in cooperation with the linker, can do just that.

That is why, for example, in chess engines, which are mostly CPU-bound, people try to squeeze out the last bit of performance by not using headers at all - and have the main file include all other cpp files. That way the compiler can optimize across the whole program (inlining functions for example).

That is stupid.
You should use a proper compiler instead.
A proper compiler can perform these optimizations even if they are in separate files.
One such compiler that I know if Visual C++. Microsoft's compiler. There are probably others, too.