samedi 22 décembre 2018

how to create instance of some class that define in other dll/lib?

I still learn how to work with cpp .. so maybe my question are stupid but i don't find those answer to my question.

I define new project that will compile as .lib

To this project i add some class with function - this is the header.

class __declspec(dllexport) MyMath
{
public:
     MyMath();
    ~MyMath();

     void Print(std::string str);
 };

Now, I add new project that is compile as .exe and will use the MyMathLib.lib

The .exe need to import (somehow) the lib and create instance of the MyMath class - and i don't know how to do it ( the import thing )

I know how to point on the lib - but there is some places that i need to add the .h file of the MyMath class - to make the linkage available.

How to do it ?

Aucun commentaire:

Enregistrer un commentaire