Help me with the simplest program for the Trusted application

I hope that someone from the large community here can help me write a simple "trusted" program that I can expand.

I am using Ubuntu Linux 9.04, with a TPM 0.60 emulator from Mario Strasser ( http://tpm-emulator.berlios.de/ ). I installed the emulator and trousers and can successfully run programs from tpm-tools after starting the tpmd and tcsd daemons.

I hope to start developing my application, but I have problems compiling the code below.

#include <trousers/tss.h>
#include <trousers/trousers.h>
#include <stdio.h>

TSS_HCONTEXT hContext;
int main()
{
     Tspi_Context_Create(&hContext);
     Tspi_Context_Close(hContext);
     return 0;
}

After trying to compile with

g ++ tpm.cpp -o tpmexe

I get errors

undefined reference to 'Tspi_Context_Create' 
undefined reference to 'Tspi_Context_Close'

What do I need for #include to compile successfully? Is there something I missed? I am familiar with C, but not quite the same with the Linux / Unix programming environment.

ps: . .

+5
1

.

:

g++ tpm.cpp -o tpmexe -ltspi
+3

All Articles