【问题标题】:Help me with the simplest program for "Trusted" application帮助我使用最简单的“受信任”应用程序程序
【发布时间】:2009-10-19 08:59:57
【问题描述】:

我希望这里大型社区的任何人都可以帮助我编写最简单的“可信”程序,我可以从中扩展。

我使用的是 Ubuntu Linux 9.04,带有来自 Mario Strasser (http://tpm-emulator.berlios.de/) 的 TPM 模拟器 0.60。我已经安装了模拟器和 Trousers,并且在运行 tpmd 和 tcsd 守护程序后可以成功地从 tpm-tools 运行程序。

我希望开始开发我的应用程序,但是我在编译下面的代码时遇到了问题。

#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;
}

尝试编译后

g++ tpm.cpp -o tpmexe

我收到错误

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

我必须#include 什么才能成功编译它?有什么我想念的吗?我熟悉 C,但不完全熟悉 Linux/Unix 编程环境。

ps:我是信息安全硕士课程的兼职学生。我参与编程主要是为了学术目的。

【问题讨论】:

    标签: c tpm


    【解决方案1】:

    你需要链接到图书馆。

    试试这个:

    g++ tpm.cpp -o tpmexe -ltspi
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多