一个让人丈二和尚摸不着头脑的编译错误

kenshu111 2005-09-24 12:16:44
请问下为什么我编译原文件是总是如下错误:
d:\BillardsServer\BillardsServer\Export.cpp(21): fatal error C1010: 在查找预编译头指令时遇到意外的文件结尾
就是当我把。CPP文件删空也解决不了,痛苦啊,这个问题从我刚学VC时就阴魂不散缠上我了,6.0和7.0都一样。
有那位大哥能帮我解决了,磕个头先
虽然搜索帮助是这样:
unexpected end of file while looking for precompiled header directive
A precompiled header did not contain a precompiled header directive.
Possible causes
Incorrect file specified as a header file.
An include file specified with /Yu (Use Precompiled Header) is not listed in the source file.
但这里准确的意思是什么啊
另外:我想在.NET里创建一个空的DLL项目,比如就一个入口函数,
如:
#include <windows.h>
//#include <afxwin.h>
BOOL WINAPI DllMain(HINSTANCE hDllHinstm,DWORD dwReason,LPVOID lpReserved)
{
return TRUE;
}
怎么用<windows.h>可以,而用〈afxwin.h>就有如下连接错误:
正在链接...
nafxcw.lib(dllmodul.obj) : error LNK2005: _DllMain@12 已经在 exp.obj 中定义
Release/exp.dll : fatal error LNK1169: 找到一个或多个多重定义的符号
虽然我知道这必须在设置里弄,但试了N次没成功(只有偶然的一个方法成功了),应该怎么办?

...全文
74 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
i_noname 2005-09-24
  • 打赏
  • 举报
回复
方法一:
项目->属性-> c/c++ ->预编译头
选择“不使用预编译头”。

方法二:

#include "stdafx.h"
放在所有文件的第一行
贵子潘 2005-09-24
  • 打赏
  • 举报
回复
unexpected end of file while looking for precompiled header directive
A precompiled header did not contain a precompiled header directive.
Possible causes
Incorrect file specified as a header file.
An include file specified with /Yu (Use Precompiled Header) is not listed in the source file.
意思:
在查找预编译头指令时遇到意外的文件结尾

用 /Yu 指定的包含文件没有列在源文件中。

您是否不小心删除了 #include 语句,而该语句引用了 /Yu 所需的 .h 文件?

15,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧