Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ code library open error in Visual C++

I am beginner developer in the VC++ environment. I used C++ code under the VS 2012 for NUnit Testing. I was trying a code in the test project but it keeps generating an error that a library file is not being opened. I checked in the project properties and there is a library named: Microsoft.VisualStudio.TestTools.CppUnitTestFramework.lib

but it still generats an error

LINK : fatal error LNK1104: cannot open file 'Microsoft.VisualStudio.TestTools.CppUnitTestFramework.lib'

Does anybody solved such problems before or you remmend me to do ?

like image 708
hab Avatar asked Mar 22 '23 17:03

hab


1 Answers

Yes, I had this Problem too. I am working on VS express 2013, and I had created a new unit for an unmanaged dll and a test unit, which refers to.

To overcome,

  • I found out, where the named CppUniTestFramework.lib is. It is not, where your VS Project files are.
    I found it under C:\Program Files(86)\Microsoft Visual Studio 12.0\VC\UnitTest\lib

  • I navigated to the file in Windows Explorer, copied the pathname out of properties and added this in Unit test Project properties under
    Linker - > Allgemein -> zusätzliche Bibliotheksverzeichnisse (Linker - > General - > Additional Library Directories).

I feel, this is not a nice solution, but it works now. I see now my first unit tests running.

like image 179
Lausberg Avatar answered Mar 29 '23 03:03

Lausberg