将VS2008的工程转换(降级)为VS2005的工程(C++)
2013-04-25 14:08
330 查看
今天在研究google protobuffer(PB)源码时,发现其提供的工程里有一个linux下的批处理“convert2008to2005.sh”,作用是将VS2008的工程及解决方案转换(降级)为VS2005的工程及解决方案。贴出来看看:
说白了,很简单,就是将解决方案(.sln)中的“Format Version 10.00”替换为“Format Version 9.00”,将“Visual Studio 2008”替换为“Visual Studio 2005”,然后将工程(.vcproj)中的“Version="9.00"”替换为“Version="8.00"”即可。明白了原理后,知道该怎么做了吧?对了,就是用文本编辑工具(例如Uedit)将以上替换完成即可。
有偷懒的同学,可能会问,能不能在windows下直接运行以上脚本?答案是不能直接运行,但可以装一个Cygwin来虚拟一个linux环境,从而实现在windows下运行linux shell脚本的功能。有兴趣的同学可以试试看(顺便也可以熟悉一下Cygwin)。以下是我的运行记录:
#! /bin/sh -e # This script downgrades MSVC 2008 projects to MSVC 2005 projects, allowing # people with MSVC 2005 to open them. Otherwise, MSVC 2005 simply refuses to # open projects created with 2008. We run this as part of our release process. # If you obtained the code direct from version control and you want to use # MSVC 2005, you may have to run this manually. (Hint: Use Cygwin or MSYS.) for file in *.sln; do echo "downgrading $file..." sed -i -re 's/Format Version 10.00/Format Version 9.00/g; s/Visual Studio 2008/Visual Studio 2005/g;' $file done for file in *.vcproj; do echo "downgrading $file..." sed -i -re 's/Version="9.00"/Version="8.00"/g;' $file done # Yes, really, that's it.
说白了,很简单,就是将解决方案(.sln)中的“Format Version 10.00”替换为“Format Version 9.00”,将“Visual Studio 2008”替换为“Visual Studio 2005”,然后将工程(.vcproj)中的“Version="9.00"”替换为“Version="8.00"”即可。明白了原理后,知道该怎么做了吧?对了,就是用文本编辑工具(例如Uedit)将以上替换完成即可。
有偷懒的同学,可能会问,能不能在windows下直接运行以上脚本?答案是不能直接运行,但可以装一个Cygwin来虚拟一个linux环境,从而实现在windows下运行linux shell脚本的功能。有兴趣的同学可以试试看(顺便也可以熟悉一下Cygwin)。以下是我的运行记录:
相关文章推荐
- 转:VS2005 & VS2008 对C++转换中问题总结
- vs2005 vs2008 vs2010间工程的转换
- VS2005、VS2008、VS2010、VS2012解决方案和工程项目文件转换方法
- vs2008 转换VS2005工程方法
- VS2010,VS2008,VS2005;工程之间的转换
- vs2008 转换VS2005工程方法:
- vs2008工程转换成vs2005工程方法
- VS2010 VS2005 VS2008工程之间的转换
- VS2005、VS2008、VS2010、VS2012解决方案和工程项目文件转换方法
- VS2010,VS2008,VS2005;工程之间的转换
- VS2008工程转为VS2005(C++)
- VS2005、VS2008、VS2010、VS2012解决方案和工程项目文件转换方法
- VS2008工程转为VS2005(C++)
- VS2008工程转为VS2005(C++)
- VS2005、VS2008、VS2010、VS2012解决方案和工程项目文件转换方法
- vs2008工程转换成vs2005工程方法
- vs2005 C++ 空工程设置断点无效的问题
- VS2008工程转化为VS2005工程
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- 从VS2005项目转换为VS2008项目(C#版)