Domanda

I need to learn how to use and manipulate the old version of Cpp Unit 1.12.1 for a client that uses it. However, when I tried to obtain a copy from SourceForge, it appears that the CPPUnit 1.12.1 version does not contain library files. There are no library files inside the lib folder! I think there's supposed to be because I'm using CppUnit with Visual Studio 2010 and all the necessary syntax is unidentifiable.

Also I was wondering how would I connect Cpp Unit 1.12.1 with Visual Studio 2010. That is, how do I add it as a reference or import the library so that Visual Studio detects that I'm using it?

Trying to do all this on windows.

EDIT: When I try building cppunit solution under debug, I receive an error similar to this. I tried setting my outdir to the same command provided in that post but it doesn't help. However, it might have something to do with converting VS 6 files to VS 10.

However, I also get these warnings:

Warning 1   warning MSB8012: TargetPath(C:\Users\~\Downloads\cppunit-1.12.1.tar\cppunit-1.12.1\cppunit-1.12.1\src\cppunit\.\Debug\cppunit.lib) does not match the Library's OutputFile property value (C:\Users\~\Downloads\cppunit-1.12.1.tar\cppunit-1.12.1\cppunit-1.12.1\src\cppunit\Debug\cppunitd.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets  1151    6   cppunit

Warning 2   warning MSB8012: TargetName(cppunit) does not match the Library's OutputFile property value (cppunitd). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).  C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets  1153    6   cppunit
È stato utile?

Soluzione

there is a Visual Studio 2010 buildable version here along with some example usage and instructions.

Hope this helps, however let me know if you need more info and I will dig some up:)

Addendum:

I was unable to replicate Error MSB3073, and the solution worked fine to build all the projects.

I have uploaded a compiled set of files from the CPP Unit 1.12.1 project at my site in case you need them urgently. Below are some instructions which should hopefully fix the problem.

Most commonly MSB3073 is related to post-build events, so you could either:

  • Right click on your project-name in Visual Studio Solution Explorer:
  • Properties >> Post-Build Event
  • Remove the text from CommandLine textbox if you don't want post-build events. Or fix the path

Whis should fix it, or try and match the properties I have set (bear in mind you may habve to set these for release and debug as well as for x86 and x64, depending on what variant(s) are giving you the problem).

For reference

I have included my settings here as they are at the default setting for CPP Unit:

CPP Unit project CPP Unit

CPP Unit DLL project CPP Unit DLL

DLL PlugIn Tester DLL PlugIn Tester

Test PlugIn Runner Test PlugIn Runner

Test Runner Test Runner

To Utilise the DLL or lib file created:

simply add the directory where the dll and lib reside to the additional library paramater shown here: Additional Lib After that all you need to do to enable the functionality within the dll or lib is #include the header and that should be you good to go.

Hopefully this will fix your problem, if not let me know:)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top