How to include TSS.CPP in another Visual Studio Project

56 Views Asked by At

I want to include TSS.CPP in my Visual Studio Solution, which has 2 projects (call them 'Controller', in CPP, and 'Driver', in C). I want to use TSS.CPP to access TPM functions in both projects (but I'm not sure if I can use CPP code in the C project), but in the docs I haven't found precise information about how to use the library in other projects, and also I'm relatively new to CPP development so maybe I'm missing something relatively easy and trivial.

The repository contains the TSS.CPP project, which is the library, and the TSS.CPP Samples project, which contains samples. I've copied the TSS.CPP folder in my solution and added the project as an existing .vcxproj file. Then I've added the TSS.CPP\include folder in the additional include directories of the Controller project and I've included Tss.h and Tpm2.h in my pch.h.

In the file where I want to use TSS.CPP functions, i've declared using namespace TpmCpp; as mentioned by the docs, but when I try to compile, i get hundreds of errors and warnings of the type "macro redefinition", "identifier not declared", and "redefinition: different linkage" from winsock2.h, ws2def.h and ws2tcpip.h.

I'm sure I've done several mistakes in the import procedure.

0

There are 0 best solutions below