当前位置: 代码迷 >> VC >> 初学VC++简单项目编译错误
  详细解决方案

初学VC++简单项目编译错误

热度:8801   发布时间:2013-02-25 00:00:00.0
初学VC++简单项目编译异常
本操作系统win2003,装有VS2008和VS2010,在VS2008中新建一个项目编译成功,但在VS2010中新建一个项目编译如下异常:

Error 1 error LNK1146: no argument specified with option '/out:' E:\XXX\w45\w45\LINK w45
Warning 2 warning D4024: unrecognized source file type '?', object file assumed E:\w45\w45\CL w45



不知道那里的配置问题??请高人解决!


声明,VS2010重已经重装过一次,还是同样问题,就差重装系统了!但请不要叫我重装系统 !谢谢!

------解决方案--------------------------------------------------------
解决如下:
   http://blog.163.com/ghzh_sd/blog/static/31549662010528458083/
------解决方案--------------------------------------------------------
嗯,看你的blog了。
不错,非常不错!
------解决方案--------------------------------------------------------
学习了。。。。。。。。。。。。顶
------解决方案--------------------------------------------------------
我也曾经出现过这样的问题,顶楼上
------解决方案--------------------------------------------------------
该回复于2010-09-10 09:27:26被版主删除
------解决方案--------------------------------------------------------
引用:
解决如下:
   http://blog.163.com/ghzh_sd/blog/static/31549662010528458083/




VS2010编译时候的一个错误解决方法  2010-06-28 16:58:00
------解决方案--------------------------------------------------------
  分类: VC的使用 
------解决方案--------------------------------------------------------
  标签: 
------解决方案--------------------------------------------------------
字号大中小 订阅 .

我的电脑上安装了VC6.0,VS2008,VS2010。

使用VS2010直接建了一个C++工程,直接编译,居然报错,报错内容如下所示:

1>------ 已启动全部重新生成: 项目: 2010test, 配置: Debug Win32 ------
1>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
1>  Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
1>  
1>  cl ??
1>  
1>CL : Command line warning D4024: unrecognized source file type '??', object file assumed
1>  Microsoft (R) Incremental Linker Version 10.00.30319.01
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  /out: 
1>  ?.exe 
1>LINK : fatal error LNK1146: 没有用选项“/out:”指定的参数
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========

 

 

呵呵,这个错误在网上很少有人说,不能因为这个问题就重新安装操作系统啊,于是,一个艰苦而又卓越的查错行动开始了。

 

在一个外文网站上发现了一个帖子,他是这么说的:

Directly speaking, this problem is caused by using an older version of compiler(cl.exe) than your VS's one. Take a look carefully underlined lines explaining version and copyright of the compiler. Again, that build log was captured from VS2010 but it's saying that copyright is valid in 1984-1998. In VS2008 and VS2010(earlier versions are not tested), when you try to build a project, VS searches a compiler to use for your build. In this step, VS doesn't choose it's own cl.exe directly but searches directories specified in the environmental variable 'path' first. (I think that VS calls cl.exe without path) Because of that, if there's another version of cl.exe in some directory of env-path, VS unexpectedly use it! This is the reason why your VS use an older one than yours. In my case, there was another cl.exe in C:\Windows\SysWOW64(I'm using Windows 7 64bit).
  相关解决方案