Getting started with CppUnit and Visual Studio 2010 - c++

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.)

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.

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.

Related

Visual Studio doesn't recognize Unreal Engine

I'm a student in Videogame Development, and just starting out looking at Unreal.
And no, none of my teachers know anything about this.
I have installed Unreal Engine 4.13 and Visual Studio Community 2013 now 2015.
I'm trying to make a C++ project using Unreal Engine (using blueprints is out of question so this didn't help)
Now, when I make a basic C++ project, Visual Studio shows the following error message:
Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.
- UE4, "C:\Users\Gebruiker\MEGA\Unreal\Disposable\Intermediate\ProjectFiles\UE4.vcxproj"
- Disposable, "C:\Users\Gebruiker\MEGA\Unreal\Disposable\Intermediate\ProjectFiles\Disposable.vcxproj"
No changes required
These projects can be opened in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.
- Engine, "Engine"
- Games, "Games"
- Disposable, "C:\Users\Gebruiker\MEGA\Unreal\Disposable\Disposable.sln"
Then my browser opens showing a Migration Report telling me that VS had an error with Project.vcxproj and UE4.vcxproj, although it copes with Engine, Games and Project.sln.
After this VS does show up without any further action, and it does automatically open *.h and *.cpp files for newly added classes in UE4.
Though it does edit and save these, it claims that all UE's code is wrong (with squiggles), and for compiling UE4 gives errors on pieces of code that apparently don't give errors on other's machines.
It would be much appreciated to be helped out, and I'm sure it would help others too who would have the same problem.
EDIT
A screenshot of the problem and configuration
EDIT 2
A screenshot of the Help -> About Visual Studio page, VS 2015 C++ highlighted
Starting with both the Unreal Engine Editor and Visual Studio closed, right click your .uproject file and select Generate Visual Studio project files, and then launch visual studio from the .sln file.
Once Visual Studio is open check your Solution Configuration is set to Development Editor. Then go to Debug > Start without Debugging (or Ctrl-F5). If everything compiles and the Editor opens again then you're good to go.
I uninstalled VS2013, installed VS2015 with all additional options checked, made a blank, new project with Unreal with just VS2015 on my pc, and now everything works fine.
Perhaps my VS2013 installation was broken, deprecated or switching version wasn't a good idea, but I can work with VS in any case now.
Also thanks to jeevcat for mentioning it!
Install newer version of the Visual Studio. VS2013 is not the latest one, VS2015 is. People report that even updating VS2013 from Update 2 to Update 4 helps resolving similar issues.

i have an application in which The manifest file contains references to Visual Studio 2008 run time,but i want to compile it in VS2010 express

i have an application(VC++) in which The manifest file contains references to Visual Studio 2008 run time,but i want to compile it in VS2010 express.what changes should be done in manifest file,although i have all libraries compiled for VS2010.
If you have the project file you should be able to open it in VS2010 and the project will offer to upgrade itself for you.
If not, you can probably 'Make a New Project from Existing Code' in VS2010 and wind up with the right manifest. I don't think VS2010 Express Edition has support for this, though.
I'd be wary about manual manifest edits, as it's not clear to me what else might be needed in VS2010 vs VS2008.

How to downgrade solution from Visual Studio 2010 to Visual Studio 2005?

I have a huge Visual Studio 2010 solution. I work with Visual Studio 2005, so I want to convert the solution to the desired version. Basically, it's a portable C++ code so it should compile on Visual Studio 2005 too. Changing the version in the *.sln file doesn't help because the *.vcxproj format is completely different from the old *.vcproj format.
Recreating the solution by hand is not an option because of its size. Also there may be some non-default compiler flags, dependencies, etc. that I don't know of (and I can't look through ALL this XML junk that I don't understand).
There is already a related question on How Do I Downgrade a C++ Visual Studio 2008 Project to 2005. However, the utility suggested there supports at most Visual Studio 2008.
Any suggestions?
It really totally sucks, that every proprietary IDE today thinks it needs to create its own project file format.
"Dear IDE developers, just use Makefiles and create a nice GUI for it so that also people without Makefile knowledge can use it!" In VS6 it was at least possible to import/export Makefiles, but not today anymore. And it was possible to use nmake for automated builds. No IDE needed to be installed, just the toolchain which could be grabbed by a simple checkout without installation.
I use CMake now. It's free, it's cross-platform, it is well supported in free IDEs like KDevelop, QtCreator, etc. It can generate Makefiles and Visual Studio projects.
So you maintain only one project source, the CMakeLists.txt file and can work with any IDE. No pain with different versions of Visual Studio or with other proprietary project file formats.
This way you can generate or VS projects for developing and you can generate Makefiles for commandline builds using nmake like in the good old days.
BTW, it's much easier to change settings in a CMakeLists.txt than clicking through various GUI dialogs. But this is a matter of personal preferences.
In my work made a utility which utilized the EnvDTE.dll and scanned a vcproj-file and optionally all vcproj-files within a sln-file. It compared all settings with a "template" and would issue a warning or optionally update the setting to correct values. We used this utility so that settings would be verified to be correct and consistent throughout all projects. I haven't updated the utility to 2010 yet due to other priorities.
EnvDTE hasn't changed much from Visual Studio 2008 to Visual Studio 2010. Perhaps it is possible to create a simple utility which opens the vcxproj-file using DTE100 and saves it using DTE90, or earlier.
Easiest way is probably to create a new project in VS 2005, and use the add existing item dialog to add the code to the project. I'd suggest using 'Empty Project' as the project type, so you don't have a lot of rubbish autogenerated for you that you'll just delete anyway.
I haven't tried it, but this looks promising:
http://www.emmet-gray.com/Articles/ProjectConverter.htm
edit: Nope, not promising, sorry :-(

OpenGL: How to compile glew32.dll from source file

I download the glew source file from http://glew.sourceforge.net/.
In the readme file, it says I should use \build\vc6.0\glew.dsw to comple the DLL.
But there are four projects after I open it in VS 2010.
When I compile them, 2 of them failed to compile.
Thanks.
Ok.
I figured it out.
Just open the the file in glew.dsw in VS 2010.
There are four projects.
Compile glew_shared, you will get glew32d.dll.
Compile glew_static, you will get glew32d.lib.
just ignore the other two.
glew32d.dll and glew32d.lib works fine in VS 2010.
This also answer my own question in
Glew in VS 2010: unresolved external symbol __imp__glewInit
Just a guess but by the way that folder is labelled, it's probably meant to compile using Visual C++ 6.0, which came with Visual Studio 6. I just gave it a quick try and built without problems under that IDE. Of course, I don't believe Microsoft offers that product anymore. If you want to build it yourself, you'll probably have to upgrade the code base to Visual C++ 2010.
I ran into the same problem. I converted the original project to Visual Studio 2010 and placed the result in https://github.com/chrisoei/glew. See the downloads section for a zip file containing glew32.dll built using VS 2010.

Visual Studio 2008 Express MFC Support

As may be known by many, the Express versions of Visual Studio 2008 don't include support for MFC and a few other packages required to compile a lot of windows programs.
So, here's my problem:
I have the full version of Visual Studio 2005. I've been using this to compile a project that a friend of mine was working on, so that I could test it out for him and continue to track bugs and things. Recently, he upgraded that project to VS 2008, which I don't have. So, I downloaded the express version in the hopes that I could simply compile with that, but no luck, it complains about headers missing left and right.
It seems to me that since I already have the full version of VS 2005, I'm bound to have at least some (perhaps older) version of the files in question that his project needs to compile against.
Is there a way I can convince VS 2008 to also look in 2005's directories for include files and library files to compile against?
Furthermore, is this a bad idea? I would really prefer not to go out and purchase VS 2008 full, as I'll never use it myself. (2005 does the job fine for me at the moment, and I tend to prefer GCC anyway.)
Thanks
You can use the VC++ compiler directly from the command line, or just create a new project w/ the source in Visual Studio 2005. Unless he is using some functionality provided in the new versions of MFC/ATL in 2008/2008sp1, you should be able to compile the project just fine.
See ("Create Project from Existing Source") in Visual Studio 2005. It is unfortunate that they don't include these libraries with the Express Editions.
Use the vcvars*.bat script(s) from Visual Studio 2005. See this blogpost from VC++ Blog to see how. You will use the old compilers, but the build system from Visual Studio 2008.
You can go into Tools>Options>Projects and Solutions>VC++ Directories
and alter the Include, Library, and Source (and Reference maybe?) folders to use VC++ 2005's folders.
I'd guess you just replace $(VCInstallDir) with a hardcoded VS 2005 path. I'd record the original values before doing this.
However, have you just tried using the OLD 2005 sln and vcproj files? Keep using 2005 on your end and 2008 on his. Keep two sets of these files for each IDE. Any issues are going to be with the library mismatch - which you're not avoiding by using 2008's tools with 2005's libraries.
The simple way to deal with this would be to revert the solution and project files back to their visual studio 2005 state from source control(you are using source control right?). At this point you can compile the project as long as your friend does not use any of the mfc 9 only functions.
The first thing I would try is loading this up in VS 2005 by just modifying the version of the .sln and the .vcproj files. In the .vcproj change the version from 9.00 to 8.00 and in the .sln change the format version from 10.00 to 9.00.
If you don't have fancy stuff in the project you have a high chance of just being able to use it like this. Also this would avoid having to update 2 project and solution files.
On this website it is shown how MFC code can be compiled with the Visual Studio Express versions:
link
Just for the record, I've done that(by modifying the include directories and library directories from inside the IDE) and it's working pretty well, I have MFC, ATL, everything.
I've found this explanation. http://www.codeproject.com/Articles/30439/How-to-compile-MFC-code-in-Visual-C-Express