#include <windows.h>
#define DllExport _declspec(dllexport)
DllExport float dll2(float x, float y)
{
float mv;
if(x>=y)
mv=y;
else
mv=x;
return mv;
}d:\test\mydll\dll2\dll2.cpp(33) : fatal error C1010: unexpected end of file while looking for precompiled header directive
#define DllExport _declspec(dllexport)
DllExport float dll2(float x, float y)
{
float mv;
if(x>=y)
mv=y;
else
mv=x;
return mv;
}d:\test\mydll\dll2\dll2.cpp(33) : fatal error C1010: unexpected end of file while looking for precompiled header directive
改为
#include "stdafx.h"
#include <windows.h>
前增加
#include "stdafx.h"
后来我见了空的工程,编译和调用都通过了。
我曾试过,把不是空的工程的配置project->setting里的和空的工程(调用成功的dll的程序)设成一样的也不行。
不知道为什么。只不过初始的工程不一样么。谁能给个解释。谢谢
改为
#include "stdafx.h"
在stdafx.h中添加
#include <windows.h>