0

I have Math.h and Math.lib. How I create dynamic link library from this files?

Barbaros
  • 9
  • 1
  • Might be a duplicate of [this](https://stackoverflow.com/questions/2384932/converting-static-link-library-to-dynamic-dll). – evan Mar 20 '18 at 19:50

1 Answers1

0

You can create project for Dynamic Link Library (DLL) and add Math.lib as input library in project properties. Also you classes in Math.h should be exported (use __declspec(dllexport) and __declspec(dllimport) for that).

#pragma once
#ifdef MATH_DLL
#define EXPORT_CLASS __declspec(dllexport)
#else
#define EXPORT_CLASS __declspec(dllimport)
#endif

class EXPORT_CLASS Math {
public:
    Math( double y );
    int DoSomething( int x );
};

Macro MATH_DLL should be defined in preprocessor definitions in project properties.

Anton Todua
  • 667
  • 4
  • 15