So, after a long time of asking you for advises about dlls, I've reached to a conclusion on how to do stuff and I would like to show it to you and tell me if it's correct.

First of all let's start with the easy stuff. C++ interfaces, doesn't even need to be exported as dlls since all the implementation is getting handle by the client. Your library just need to define that interface inside a header file, and the client the only thing he need's to do is to include that header file, inherit that interface and implement the abstract methods.

Now let's talk about classes which are not getting inherited by the client. People here told me that the best way is to create a C factory function that generates an instance of that class. I understand how this works but what about the Methods? Do I have to create a C function wrapper for each method of that class and export these functions into the dll? Consider the code below:

MyClass.h
Code:
class MyClass
{
	public:
		MyClass();
		~MyClass();
		void PrintHi();
};
MyClass.cpp
Code:
#include "MyClass.h"
#include <iostream>

MyClass::MyClass(){}
MyClass::~MyClass(){}
void MyClass::PrintHi(){ std::cout << "Hi!" << std::endl; }

extern "C"
{
	__declspec(dllexport) MyClass *CreateMyClass()
	{
		return new MyClass();
	}
	
	__declspec(dllexport) void DeleteMyClass(MyClass *obj)
	{
		delete obj;
	}
	
	__declspec(dllexport) void PrintHi(MyClass *obj)
	{
		obj->PrintHi();
	}
}
So, do I need to create a C wrapper for each Method? Because I tried to only create a factory function (CreateMyClass) and on the client side every time I was using myObj->PrintHi() the compiler was saying "Undefined reference to PrintHi()" and this make sense since I did not export that Method into the dll. This C wrappers will probably work but I'm loosing the C++ way of using a class. And what if I want to inherit that class? How is the constructor of the base class is going to get called since i haven't exported it? As you can see I'm losing all the good object oriented stuff C++ give's me when using C wrappers.

I thought this carefully and I noticed that every C++ library I used until know (And because I'm a graphics programmer I use a lot of libraries) all of them where only header libraries. Is this a coincidence? Maybe dlls are the reason? You can't export classes into dlls which are going to be compatible with all the compilers out there but what you can do is actually write the whole implementation of you library into header files and let the client include these headers and compile them easily by himself. Is this a good practice to do when creating libraries in c++, since exporting classes into dlls should be a NO for compatibility reasons?

And then I also thought about precompiled libraries. Why not creating my whole library into header files only and then create a pch.h file that includes all of the necessary files and let the client include that pch.h file, compile it the first time only and use it as a precompiled library. Fast, easy to compile and has compatibility.

So what do you thing? Have I understand everything correctly? Do you have any better ideas?
Thank you!