一个dll动态库的问题
MYDLL.CPP (源文件)
#include"MyDll.h"
int WINAPI DllMain ( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved)
{
return TRUE ;
}
EXPORT int CALLBACK Max(int a, int b)
{
if(a>=b)
{
return a;
}
else
{
return b;
}
}
EXPORT int CALLBACK Min(int a, int b)
{
if(a>=b)
{
return b;
}
else
{
return a;
}
}
头文件 :MYDLL.H
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif
EXPORT int CALLBACK Max(int a, int b);
EXPORT int CALLBACK Min(int a, int b);
提示出错:
Compiling...
MyDll.cpp
d:\vc\c\c_dll\mydll\mydll\mydll.h(8) : error C2146: syntax error : missing ';' before identifier 'Max'
d:\vc\c\c_dll\mydll\mydll\mydll.h(8) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
MyDll.obj - 2 error(s), 0 warning(s)