积极答复者
c语言怎样编译成DLL?

问题
-
c语言怎样编译成DLL,特别是引用#include "fltuser.h"后怎样编译,因为我发现执行#include "fltuser.h"后就编译不过了,用vc6.0去编译还是用WDK的build去编译呢?请帮帮忙!
- 已移动 Sheng Jiang 蒋晟 2010年10月2日 22:49 (发件人:Visual C++)
答案
-
呃,什么编译错误?
DLL为什么要用WDK编译?又不是驱动程序。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 duoduobearModerator 2011年6月8日 7:17
全部回复
-
呃,什么编译错误?
DLL为什么要用WDK编译?又不是驱动程序。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 duoduobearModerator 2011年6月8日 7:17
-
我用VC6.0进行编译,将其放在first.c文件里面,代码如下
#include <windows.h>
//#include "fltuser.h"__declspec(dllexport) int add(int a, int b);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}int add(int a,int b)
{
return a+b;
}
如果不注释掉#include "fltuser.h",就提示:
d:\work\mystrength\kernel\cdll3\fltuser.h(68) : fatal error C1083: Cannot open include file: 'fltUserStructures.h': No such file or directory
因为fltuser.h里面有一段代码是 #include <fltUserStructures.h>
如果我将其fltuser.h里面的代码改为 #include "fltUserStructures.h",又报错如下:
d:\work\mystrength\kernel\cdll3\fltuserstructures.h(22) : fatal error C1012: unmatched parenthesis : missing ')'
不知道应该如何解决,希望版主能够帮帮忙!
-
呃,创建一个fltuserstructure.c然后包含fltuserstructure.h,编译是否有同样错误?
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
那就是头文件的问题。unmatched parenthesis表示有语法错误,联系这个头文件的作者。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
WDK的文件应该用DDKBuild编译,不要用VC。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
WDK安装正常的话应该编译通过的。如果你的WDK编译不通过示例代码,卸载你的WDK之后重新安装。
VC编译器不支持面向操作系统核心的驱动代码的编译。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP