I have Math.h
and Math.lib
. How I create dynamic link library from this files?
Asked
Active
Viewed 147 times
1 Answers
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