vc编译就卡死出错

C/C++(18)
1、fatal error C1010: unexpected end of file while looking for precompiled header directive。
寻找预编译头文件路径时遇到了不该遇到的文件尾。(一般是没有#include &stdafx.h&)
2、fatal error C1083: Cannot open include file: 'R…….h': No such file or directory
不能打开包含文件“R…….h”:没有这样的文件或目录。
3、error C2011: 'C……': 'class' type redefinition
类“C……”重定义。
4、error C2018: unknown character '0xa3'
不认识的字符'0xa3'。(一般是汉字或中文标点符号)
5、error C2057: expected constant expression
希望是常量表达式。(一般出现在switch语句的case分支中)
6、error C2065: 'IDD_MYDIALOG' : undeclared identifier
“IDD_MYDIALOG”:未声明过的标识符。
7、error C2082: redefinition of formal parameter 'bReset'
函数参数“bReset”在函数体中重定义。
8、error C2143: syntax error: missing ':' before '{'
句法错误:“{”前缺少“;”。
9、error C2146: syntax error : missing ';' before identifier 'dc'
句法错误:在“dc”前丢了“;”。
10、error C2196: case value '69' already used
值69已经用过。(一般出现在switch语句的case分支中)
11、error C2509: 'OnTimer' : member function not declared in 'CHelloView'
成员函数“OnTimer”没有在“CHelloView”中声明。
12、error C2511: 'reset': overloaded member function 'void (int)' not found in 'B'
重载的函数“void reset(int)”在类“B”中找不到。
13、error C2555: 'B::f1': overriding virtual function differs from 'A::f1' only by return type or calling convention
类B对类A中同名函数f1的重载仅根据返回值或调用约定上的区别。
14、error C2660: 'SetTimer' : function does not take 2 parameters
“SetTimer”函数不传递2个参数。
15、warning C4035: 'f……': no return value
“f……”的return语句没有返回值。
16、warning C4553: '= =' : op did you intend '='?
没有效果的运算符“= =”;是否改为“=”?
17、warning C4700: local variable 'bReset' used without having been initialized
局部变量“bReset”没有初始化就使用。
18、error C4716: 'CMyApp::InitInstance' : must return a value
“CMyApp::InitInstance”函数必须返回一个值。
19、LINK : fatal error LNK1168: cannot open Debug/P1.exe for writing
连接错误:不能打开P1.exe文件,以改写内容。(一般是P1.Exe还在运行,未关闭)
20、error LNK2001: unresolved external symbol &public: virtual _ _thiscall C……::~C……(void)&
连接时发现没有实现的外部符号(变量、函数等)。
关于VC编译错误fatal error C1083的解决办法
这时因为该模块没有包括预编译头文件“stdafx.h”的缘故。
VC用一个stdafx.cpp包含头文件stdafx.h,然后在stdafx.h里包含大部分系统头文件,这
样编译时VC就通过编译stdafx.cpp把大部分系统头文件预编译进来了,在Debug目录下有
一个很大的文件*.pch,这里就存储了预编译信息。
根据这个原理,如果这个pch损坏了或被删除了,系统重新编译时就会抱怨“cannot&open
precompiled&header&file&debug/*.pch”。这时怎么解决这个问题呢,
打开Project-》Setting对话框选C++页,将Category下拉式列表框选中Precompiled&Headers,
最简单的办法就是选中第一个选项“Not&using....&,这样就根本不用预编译头也不去寻找pch文件,
就不会出错了,但是这样做的后果是每次编译、连接都化更多的时间。
第二个选项”Automatic&...&,然后在“Through&header”力填上stdafx.h,这样
如果没有pch文件系统会自动生成一个pch,如果有的话就使用这个pch,这个选项是比较“
智能”的。
第三个选项是强行创建一个pch文件,第四个选项是直接使用pch文件。当然“Through
headers”里都填stdafx.h了。
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
解决办法:
PROJECT-&SETING-&C/C++-&PREPROCESSOR-&定义 _AFXDLL,完毕。
LINK : warning LNK4098: defaultlib &MSVCRT& conflicts wi use /NODEFAULTLIB:library
解决办法:
PROJECT-&SETING-&LINK-&INPUT-&IGNORE LIB...-&MSVCRT.LIB
以下转其他,
1. Linking...
&&&&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
&&&&VC++默认的工程设置是单线程的,而你使用了多线程,所以要修改设置。选择菜单“Project|settings”,选择C/C++标签,在CODE GENERATION分类中选择除SINGLE-THREADED的其他选择。
2.fatal error C1010: unexpected end of file while looking for precompiled header directive
&&&&两个办法:
&&&&--&肯定是一个新添加的类的.cpp文件开头没包含stdafx.h,在该文件最前面加上即可
&&&&--&有时可以使用右键点击项目工程中的该cpp文件,选择setting,在c/c++栏,选择PreCompiled headers,然后设置第一选项,选择不使用预编译头,解决这个问题。
3.在编译时产生的下面的代码,那么下面的代码中的括号内的数字代表什么意思,还有error后的数字呢?
&&&&Compiling...
&&&&CalWnd.cpp
&&&&E:\StudyVC\CalendarApp\CalWnd.cpp(1092) : error C2065: 'TTS_BALLOON' : undeclared identifier
&&&&E:\StudyVC\CalendarApp\CalWnd.cpp(1092) : error C2059: syntax error : ')'
&&&&E:\StudyVC\CalendarApp\CalWnd.cpp(1092) : warning C4552: '|' : op expected
operator with side-effect
&&&&Error executing cl.exe.
Q:括号中的数字是出错的代码行的行号。例如错误中的第1行表示CalWnd.cpp的1092行出现了错误。如果想快速找到这行,可以在错误信息行上双击鼠标,这时VC++会自动打开CalWnd.cpp文件并定位到这行。
Error后面的数字表示错误代号。错误代号分为两类:C开头的是编译错误,即你的代码存在语法错误,你需要修改代码;LNK开头的是链接错误,通常你的代码并没有语法错误,可能是配置错误引起的,但有时LNK可能是由于拼写错误引起的。在错误信息行上按F1键,VC++会打开MSDN帮助并显示关于该错误信息的一个简单的解释,你可以根据该解释来知道到底是什么意思。
4.vc编译的时候可以设置两个版本:debug和release,debug版本在运行的时候点击帮助菜单的about对话框出现如下错误信息:
&&&&Debug Assertion Failed:
&&&&Program :C:\fuan\Debug\fuan.exe
&&&&File:wincore.cpp
&&&&Line:628
&&&&For information on how your program can cause an assertion failure,see visual c++ documentation on asserts.
&&&&(Please retry to debug application).
&&&&但是如果把配置改成release版本,就不会出现问题,about对话框弹出正常。使用的是同一个源程序,为什么会出现不同的结果?
在MFC中,大量使用了ASSERT宏,这些宏通常可以来纠正一些错误,如还没有初始化指针就使用等。你所遇到的信息就是ASSERT宏报告的错误。通常你要检查一下是否存在错误。在Release方法下,ASSERT宏不会执行,所以也没有错误信息。不过,MFC中的ASSERT宏有时管得有点宽,如果确认没有错误,也可以不理会它。
5. 在win2000上能编译的程序到了win98就不能编译了。
&&&&没有出错信息,一编译就停在
&&&&--Configuration: Monitor - Win32 Release-------
&&&&Copying contents file...
&&&&是不是跟*.hpj文件有关系,应该怎么改?
Q:是和编译帮助文件有关,据说如果在Win98下安装了Norton AntiVirtus 2000就会出现这种问题。可以把帮助文件从工程中去掉:
&&&&1、在FileView标签下,选择Source Files文件夹下面的.hpj文件。
&&&&2、右击文件并从菜单中选择Settings。
&&&&3、点击General标签。
&&&&4、清除掉Always use custom build step选项并选择Exclude file from build。
6.在用EnumWindows(EnumWindowsProc,(LPARAM)0);编译时老是出错:cannot convert parameter 1 from 'int (struct HWND__ *,long)' to 'int (__stdcall *)(struct HWND__ *,long)'
Q:实际上看一下错误信息就知道,你的EnumWindowsProc大概定义为:
&&&&int EnumWindowsProc(HWND, long);
&&&&实际应该定义为:
&&&&int __stdcall EnumWindowsProc(HWND, long);
7.编译以WinMain开头的函数出现LNK2001错误
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
&&&&Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals
Q:估计是选错了工程类型。在VC中除了可以编译MFC程序外,还可以建立Win32 Application,以WinMain为主函数。可以在VC中建立Win32 Application,然后加入你的C程序,然后编译即可。
8.编译后出现大量错误信息怎么办
错误信息如下:
&&&&Info :Compiling C:\user\x.cpp
&&&&Error: x.cpp(20,26):Call to undefined function 'loadCursor'
&&&&Error: x.cpp(20,15):Cannot convert 'int' to 'HICON__ *'
&&&&Error: x.cpp(23,21):Cannot convert 'void *' to 'HBRUSH__ *'
&&&&Error: x.cpp(30,6):Undefined symbol 'hWnd'
&&&&Error: x.cpp(32,13):Cannot convert 'void *' to 'HINSTANCE__ *'
&&&&Error: x.cpp(32,13):Type mismatch in parameter 'hInstance' in call to
&&&&'__stdcall CreateWindowExA(unsigned long,const char *,const char
&&&&*,unsigned long,int,int,int,int,HWND__ *,HMENU__ *,HINSTANCE__ *,void
&&&&Error: x.cpp(33,32):Undefined symbol 'SHOW_MAXIMIZED'
&&&&Warn : x.cpp(40,2):'hwnd' is declared but never used
&&&&Warn : x.cpp(40,2):Parameter 'lpszCmdLine' is never used
&&&&Warn : x.cpp(40,2):Parameter 'nCmdShow' is never used
&&&&Error: x.cpp(54,20):Illegal structure operation
&&&&Error: x.cpp(54,41):Undefined symbol 'tmExternalLeading'
&&&&Error: x.cpp(56,40):Undefined symbol 'poshorzscoll'
&&&&Error: x.cpp(57,40):Undefined symbol 'posvertscoll'
&&&&Error: x.cpp(58,16):Call to undefined function 'SetSCrollRange'
&&&&Error: x.cpp(135,73):Function call missing )
&&&&Error: x.cpp(142,7):Misplaced break
&&&&Error: x.cpp(143,5):Case outside of switch
&&&&Error: x.cpp(143,17):Expression syntax
&&&&Error: x.cpp(145,7):Misplaced break
&&&&Error: x.cpp(146,8):Default outside of switch
&&&&Warn : x.cpp(148,2):'slength' is declared but never used
&&&&Error: x.cpp(149,7):Declaration terminated incorrectly
&&&&Error: x.cpp(150,2):Unexpected }
Q:不可能一一为你分析错误,告诉你一些消除错误的原则,你自己来逐一分析,这样你才能学会编程。
&&&&首先,用不着见到错误就六神无主。错误信息虽多,但没什么了不起。编译错误就象是拼写检查的结果。
&&&&下面,看看有多少条错误信息(Error)和警告(Warn)。当然先分析错误信息,有些警告是由于错误信息产生的。如果你对某条错误信息的含义不了解,可以选择该条错误信息,然后按F1键,在帮助文件中肯定会有更详细的介绍。
&&&&绝大多数编译错误实际上都是拼写错误。看看你的程序吧。凡是undefined错误都是拼写错误。象把LoadCursor写成loadCursor,hWnd写成hwnd,别忘了C/C++是区分大小写的!还有把SW_SHOWMAXIMIZED写成SHOW_MAXIMIZED。有时候记忆出了错误,查查手册或帮助就行了。
&&&&接下来,要查“(”、“)”、“{”、“}”等各种括号的匹配问题。Function call missing )、Misplaced break、Case outside of switch这些信息都说明你的程序中存在匹配问题。你的程序中有一行 TextOut(hdc,-charwt*(poshorzscroll,charht*(t-posvertscroll),szbuffer,i);} 显然少了一个“)”括号。一般在检查这种错误时,必须找到第一个出现此类错误的地方,修改后一般立即重新
编译,因为一个匹配错误可能引发几十个错误,继续查后面的错误意义不大。
&&&&剩下的Cannot convert、Type mismatch错误是数据类型转换错误。这其实不一定是错误,因为C++对参数类型检查的要严格一些,所以有时要尽可能使用强制类型转换来避免这种错误。比如你的
&&&&wcAPP.hbrBackground=GetStockObject(WHITE_BRUSH);
&&&&导致Cannot convert 'void *' to 'HBRUSH__ *'错误,你可以试着在相关参数前加上(HBRUSH),改成
&&&&wcAPP.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
&&&&对于这类转换,不同的C++系统可能不同,所以有的时候不写也可以,但我建议要强制转换,这样麻烦少。同时要注意变量类型是否可以强制转换,比如有的参数为指针类型,要在普通变量前加“&”操作符。这要参考有关函数的帮助。
在创建MFC项目时, 不使用MFC AppWizard向导, 如果没有设置好项目参数, 就会在编译时产生很多连接错误, 如error LNK2001错误, 典型的错误提示有:
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol&
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol&
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
下面介绍解决的方法:
1. Windows子系统设置错误, 提示:
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Windows项目要使用Windows子系统, 而不是Console, 可以这样设置:
[Project] --& [Settings] --& 选择&Link&属性页,
在Project Options中将/subsystem:console改成/subsystem:windows
2. Console子系统设置错误, 提示:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol&
控制台项目要使用Console子系统, 而不是Windows, 设置:
[Project] --& [Settings] --& 选择&Link&属性页,
在Project Options中将/subsystem:windows改成/subsystem:console
3. 程序入口设置错误, 提示:
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol&
通常, MFC项目的程序入口函数是WinMain, 如果编译项目的Unicode版本, 程序入口必须改为wWinMainCRTStartup, 所以需要重新设置程序入口:
[Project] --& [Settings] --& 选择&C/C++&属性页,
在Category中选择Output,
再在Entry-point symbol中填入wWinMainCRTStartup, 即可
4. 线程运行时库设置错误, 提示:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
这是因为MFC要使用多线程时库, 需要更改设置:
[Project] --& [Settings] --& 选择&C/C++&属性页,
在Category中选择Code Generation,
再在Use run-time library中选择Debug Multithreaded或者multithreaded
Single-Threaded&&&&&&&&&&&&&&&&单线程静态链接库(release版本)
Multithreaded&&&&&&&&&&&&&&&&&&多线程静态链接库(release版本)
multithreaded DLL&&&&&&&&&&&&&&多线程动态链接库(release版本)
Debug Single-Threaded&&&&&&&&&&单线程静态链接库(debug版本)
Debug Multithreaded&&&&&&&&&&&&多线程静态链接库(debug版本)
Debug Multithreaded DLL&&&&&&&&多线程动态链接库(debug版本)
单线程: 不需要多线程调用时, 多用在DOS环境下
多线程: 可以并发运行
静态库: 直接将库与程序Link, 可以脱离MFC库运行
动态库: 需要相应的DLL动态库, 程序才能运行
release版本: 正式发布时使用
debug版本: 调试阶段使用
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:2955次
排名:千里之外
原创:19篇
转载:16篇
译文:10篇
(16)(6)(2)(2)(21)温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(11462)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'VC++编译时总出现 OBJ - 1 error(s), 0 warning(s)错误的解决办法[原创]',
blogAbstract:'
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}vc编译出错总是提示error C2653解决办法 - C++当前位置:& &&&vc编译出错总是提示error C2653解决办法vc编译出错总是提示error C2653解决办法&&网友分享于:&&浏览:226次vc编译出错总是提示error C2653[del][/del]-------------------Configuration: premfcc - Win32 Debug--------------------Compiling...cmfcc.cppe:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(4) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(7) : warning C4508: 'myc' : function s 'void' return type assumede:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(8) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(9) : error C2084: function 'int __cdecl myc(void)' already has a bodye:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(11) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(13) : error C2065: 'm_rate' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(14) : error C2065: 'm_size' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(15) : error C2065: 'm_dimen' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(16) : error C2065: 'm_framel' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(17) : error C2065: 'm_framelm' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(18) : error C2065: 'm_fnum' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(19) : error C2065: 'm_frame' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(28) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(31) : error C2065: 'pi' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(33) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(48) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(55) : error C2065: 'fmel' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(56) : error C2065: 'melf' : undeclared identifiere:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(61) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of datae:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(70) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(71) : error C2373: 'fmel' : different type modifierse:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(74) : error C2653: 'myc' : is not a class or namespace namee:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(75) : error C2373: 'melf' : different type modifierse:\最近\中间产品\mfcc\lateremfcc\cmfcc.cpp(78) : error C2653: 'myc' : is not a class or namespace nameError executing cl.exe.premfcc.exe - 22 error(s), 2 warning(s)我检查差了数据和变量没有什么错误啊,在一个creat函数中我对所有类的私有变量进行了初始化,怎么还出现这个,还有就是我把类名换了好多次,绝对没有重名,也没有定义成变量,怎么会出错呢?????------解决方案--------------------头文件
------解决方案--------------------#include &stdafx.h& 要放到cpp里面。
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有sinojelly 的BLOG
用户名:sinojelly
文章数:264
评论数:1484
访问量:1183626
注册日期:
阅读量:5863
阅读量:12276
阅读量:377029
阅读量:1069946
51CTO推荐博文
一、问题现象VC2010编译任何工程都出错。错误信息:1&------ Build started: Project: UserModule, Configuration: Debug Win32 ------1&C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5): error MSB6006: &CL.exe& exited with code -.========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========二、解决办法1、原因通过观察,发现工程属性中的可执行文件路径指向VC2008的路径。2、一种临时解决办法设置工程属性中的可执行文件路径。C:\Program Files\Microsoft Visual Studio 10.0\VC\bin&设置之后,编译果然成功了。但是,不可能每个工程都去修改一次工程属性吧?3、最终解决办法在Property Manager中修改VC++目录(注:这里的修改是全局生效的。与项目、属性中的设置不同。)&打开Property Manager的方法:View-&Property Manager (it is near the bottom) or View-&Other Windows-&Property Manager修改为:(ExcludePath暂时未做修改)C:\Program Files\Microsoft Visual Studio 10.0\VC\C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\$(ExecutablePath)C:\Program Files\Microsoft Visual Studio 10.0\VC\$(IncludePath)C:\Program Files\Microsoft Visual Studio 10.0\VC\C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\$(ReferencePath)C:\Program Files\Microsoft Visual Studio 10.0\VC\C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\$(LibraryPath)C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\$(SourcePath)&&注:网上也有资料介绍下面这种清除用户数据的方法,但我的环境上这种操作不能解决问题。&打开VS2010命令行,执行 devenv /ResetUserData, 稍等一会,完成。然后再启动VS2010,会提示第一次启动时的环境设置对话框,去掉“Migrate 老的设置”前面的对勾,然后启动VS2010。&三、参考资料感谢这个帖子中提供解决方案的crescens2k。Right, if you notice the path to your compiler it is actually picking up the VC9 compiler on your system. This is why you are getting this problem. This is a known bug in the environment.What you can try is1) Open your Visual Studio Command Prompt (Can get to it through Start-&All Programs-&Microsoft Visual Studio 2010-&Visual Studio Tools-&Visual Studio Command Prompt)2) Run DevEnv /ResetUserData wait for it to finish (it may take a while)3) Open Visual Studio itself and it will give you the same window as when you first run Visual Studio. Make sure you deselect Migrate my eligable settings checkbox before you select your configuration and then select Start Visual Studio.4) Open your project and try again.If it still fails then it is likely that something was saved into the project itself. In this case go to Project Properties-&Configuration Properties-&VC++ Directories and replace set each of the Paths to the FollowingExecutable Directories to $(ExectablePath)Include Directories to $(IncludePath)Reference Directories to $(ReferencePath)Library Directories to $(LibraryPath)Source Directories to $(SourcePath)Exclude Directories to $(ExcludePath)Please note you need to keep the exact formatting, so when you locate Executable Directories, in the box on the right replace the entire contents with $(ExecutablePath) for example. If you do that you will put the project specific settings to the default too and (hopefully) will fix everything.----------------------------------------It was still inherited even after you reset your environment?Hmm, ok.Open up Property Manager, if you selected the VC configuration then it should be on the left automatically. If not, you can find it either under View-&Property Manager (it is near the bottom) or View-&Other Windows-&Property Manager. You will need a VC project loaded. In Property Manager, under &Project Name&-&Debug | Win32 look for Microsoft.Cpp.Win32.User.Right click on this and select properties. Go to Common Properties-&VC++ Directories and check these out. But since these should inherit from the others directly then the best you can do is override the paths yourself here. The only thing that I could think of to override these is if you have VSINSTALLDIR and VCINSTALLDIR set on a global scale.Could you look at one final thing, if you go to Control Panel-&System-&Advanced system settings and click on the Environment Variables button. Under&either of these can you find VCINSTALLDIR and VSINSTALLDIR set to anything?&
了这篇文章
类别:未分类┆阅读(0)┆评论(0)}

我要回帖

更多关于 vc中建立源文件 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信