Hey,

I've had a discussion recently, with a friend of mine, which ended with the question: "How can you write an interface for an object-oriented library in pascal".

In C/C++, you have separate *.h and *.cpp files. If you want to distribute your library, you compile your code and you just distribute the binaries and the *.h header files.

But In pascal, everything (interface and implementation) is combined into one file. So, you have to do it in a different way.

Let's say someone writes a totally awesome object-oriented library in C++. Someone else would like to make pascal headers for this, but how? Pascal classes and C++ classes aren't compatible. Would the only option be to write a C++ wrapper that flattens all OOP to a C-style kind of interface (like dglOpenGL.pas), and have pascal code link against that wrapper?

Thanks.