CppUnit 和 Visual Studio 2010 入门
我一直在寻找答案,直到我变得斗鸡眼和困惑为止。
我有一个带有 Visual Studios 2010 的 Windows XP 环境。我已将 CppUnit 1.12.1 从 Sourceforge 下载并解压到 C:\CppUnit。我知道我必须使用 Visual Studio 打开 src/CppUnitLibraries.dsw 并批量构建它打开的所有项目以使用库填充 lib 目录。这实质上是 CppUnit“安装”过程的范围。
但是,当我尝试打开 CppUnitLibraries.dsw 时,Visual Studio 表示该项目必须转换为当前的 Visual C++ 项目格式。如果我单击“是”(转换并打开项目),它会说无法加载项目文件,并询问我是否要从解决方案中删除可卸载的项目,我对此说“否”,因为我确信这不是我想要发生的事情。它为 CppUnitLibraries.dsw 解决方案中的许多项目执行此操作,我假设这是不需要的行为。
我的一些搜索结果表明我应该打开 src\msvc6\testrunner\MsDevCallerListCtrl.cpp,找到显示...
#import "libid:80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2" version(" 的行7.0") lcid("0") raw_interfaces_onlynamed_guids
"
...和将 7.0 替换为 10.0。但是
我做错了什么吗?我必须做什么才能开始使用 CppUnit?(如果这是一个非常菜鸟的问题,我很抱歉。我陷入困境,沮丧,非常)使困惑。)
I have searched for answers until I have become crossed-eyed and confused.
I have a Windows XP environment with Visual Studios 2010. I have downloaded and extracted CppUnit 1.12.1 from Sourceforge to C:\CppUnit. I understand I must use Visual Studio to open src/CppUnitLibraries.dsw and Batch Build all of the projects it opens to populate the lib directory with libraries. This is essentially the extent of the CppUnit "installation" process.
However when I try to open CppUnitLibraries.dsw, Visual Studio says the project must be converted to the current Visual C++ project format. If I click "yes" (to convert and open the project), it says the project file cannot be loaded and it asks if I want to remove the unloadable project from the solution, to which I say "No" since I'm certain this is not what I want to have happen. It does this for many projects in the CppUnitLibraries.dsw solution and I'm assuming this is unwanted behavior.
A few of my search results indicated that I should open src\msvc6\testrunner\MsDevCallerListCtrl.cpp, find the line that says...
#import "libid:80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2" version("7.0") lcid("0") raw_interfaces_only named_guids
"
...and replace the 7.0 with 10.0. But this does not help.
Am I doing something wrong? What must I do to get started with CppUnit? (I'm sorry if this is a very noobish question. I'm stuck, frustrated, and very confused.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已成功将 CPPUNIT 1.12.1 转换为 VS2010 解决方案。此处描述: http://blogs.powersoft.ca/erict/archive/2012/02/21/cppunit-in-vs2010ndashwith-a-sample.aspx 可以从那里下载解决方案。
I've successfully converted CPPUNIT 1.12.1 to be a VS2010 solution. It's described here: http://blogs.powersoft.ca/erict/archive/2012/02/21/cppunit-in-vs2010ndashwith-a-sample.aspx and the solution can be downloaded from there.
我相信扩展名 .dsw 是在 1998 年由 Visual Studio 6 使用的。
到了 Visual Studio .NET 2003,它们已转移到 .sln 解决方案文件。尽管格式有所改变,但 Visual Studio 2010 仍然使用 2010 文件。
因此,如果您下载了一些附带 .dsw 文件的软件,Visual Studio 2010 需要将该文件转换为 .sln 才能使用它。
多年来,每次我们在工作中升级到较新版本的 Visual Studio 时,都必须针对较新的编译器进行一些源代码更改。所以我想说,.dsw 文件附带的任何 C++ 代码可能需要付出一些巨大的努力。
我建议尝试寻找更新的 CppUnit 版本或版本,或者寻找其他工具。
这个问题看起来很有用。
I believe that the extension .dsw was used by Visual Studio 6 in 1998.
By Visual Studio .NET 2003, they had moved to .sln Solution Files. Although the format has changed somewhat, Visual Studio 2010 still uses 2010 files.
So, if you've downloaded some software that comes with a .dsw file, Visual Studio 2010 will need to convert that file to a .sln to be able to use it.
Each time we've upgraded to a newer version of Visual Studio, at work, over the years, we've had to make some source code changes, for the newer compiler. So I'd say that any C++ code which comes with .dsw file is likely to require some significant effort.
I'd suggest trying to find a newer build or version of CppUnit, or looking for another tool.
This question looks useful.