我编写了一个C++MFC程序,编译连接运行都没有错误,但是当我退出之后再打开.cpp文件时,编译
我编写了一个C++MFC程序,编译连接运行都没有错误,但是当我退出之后再打开.cpp文件时,编译没错但是连接出现错误,这是为什么呀?我打开以前运行过的程序也是这样,重新编...
我编写了一个C++MFC程序,编译连接运行都没有错误,但是当我退出之后再打开.cpp文件时,编译没错但是连接出现错误,这是为什么呀?我打开以前运行过的程序也是这样,重新编写新的MFC程序也是这样,但是我打开控制台应用程序却能正常运行。我真的很烦,找不出错误的根源,求大神指点呀。不胜感激!
连接时出现的错误为:
Linking...
11084128.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMy11084128Doc::classCMy11084128Doc" (?classCMy11084128Doc@CMy11084128Doc@@2UCRuntimeClass@@B)
11084128.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMainFrame::classCMainFrame" (?classCMainFrame@CMainFrame@@2UCRuntimeClass@@B)
11084128.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMy11084128View::classCMy11084128View" (?classCMy11084128View@CMy11084128View@@2UCRuntimeClass@@B)
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/11084128.exe : fatal error LNK1120: 6 unresolved externals
执行 link.exe 时出错.
11084128.exe - 1 error(s), 0 warning(s) 展开
连接时出现的错误为:
Linking...
11084128.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMy11084128Doc::classCMy11084128Doc" (?classCMy11084128Doc@CMy11084128Doc@@2UCRuntimeClass@@B)
11084128.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMainFrame::classCMainFrame" (?classCMainFrame@CMainFrame@@2UCRuntimeClass@@B)
11084128.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMy11084128View::classCMy11084128View" (?classCMy11084128View@CMy11084128View@@2UCRuntimeClass@@B)
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/11084128.exe : fatal error LNK1120: 6 unresolved externals
执行 link.exe 时出错.
11084128.exe - 1 error(s), 0 warning(s) 展开
2个回答
推荐于2016-02-29
展开全部
试试看
[Project]-->[Settings] --> 选择 Using MFC in a static library (在静态库中使用 MFC )
不行的话在改改这个:
[Project] --> [Settings] --> 选择"C/C++"属性页,在Category中选择Code Generation,
再在Use run-time library中选择Debug Multithreaded或者multithreaded[Project] --> [Settings] --> 选择"Link"属性页,
在Project Options中将/subsystem:windows改成/subsystem:console
追问
追答
2014-11-10
展开全部
打上断点,或者box,看看在哪出错了
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询