15,471
社区成员
发帖
与我相关
我的任务
分享
#ifndef _DLL_TUTORIAL_H_
#define _DLL_TUTORIAL_H_
#include <iostream>
#if defined DLL_EXPORT
#define DECLDIR __declspec(dllexport)
#else
#define DECLDIR __declspec(dllimport)
#endif
extern "C"{
DECLDIR int Add( int a, int b );
DECLDIR void Function( void );
}
#endif
#include "stdafx.h"
#include <iostream>
#include "dll.h"
#define DLL_EXPORT
extern "C"{
DECLDIR int Add( int a, int b )
{
return( a + b );
}
DECLDIR void Function( void )
{
std::cout << "DLL Called!" << std::endl;
}
}