2014年1月29日星期三

\Microsoft was unexpected at this time

作为一名Windows开发者,visual studio是最常用的开发工具之一。虽然真正的开发过程肯定用vs开发,但是有些时候只是想验证个算法时,就会用Visual Studio Command Prompt在命令行直接编译运行看下。命令行编译省时省力,不用建项目也没有繁多的编译生成物。算是我从TC走来继承的优良传(lou)统(xi)吧。

但是,这两天命令行忽然不能用了!
百思不得其解。

今日得闲,google到了同病相怜之人。
附上搜到的两条链接,\Microsoft was unexpected at this timeSerious Visual Studio 2008 install bug that can break your builds
He mentioned that as he found out, one of the directories where SDK was had braces in the name as well, and that broke the statement above completely as batch processor would find nested parentheses in the folder’s name and consider them as the end of the statement.
So, the fist thing you should do if you’re having the same problem: look at your %PATH% environment variable and check if anything is enclosed in double quotes.

我查了下我的环境变量,果然有一条路径加了莫名其妙的双引号!
"C:\Program Files (x86)\Microsoft DirectX SDK (October 2006)\Utilities\Bin\x86";
是安装DirectX SDK时自动添加的环境变量,原来问题的始作俑者还是Microsoft自家的产品……

删掉双引号,世界恢复如初了。

PS. Blogger不智能啊,插入的图片不能自动适应页面大小?

没有评论:

发表评论