# tar -xvzf tpm_emulator-X.Y.tar.gz# cd tpm_emulator-X.Y# mkdir build# cd build# cmake ../# make# make install在执行到cmake ../的时候,就提示一下错误:jianglu@jianglu-K43SJ:~/tpm_emulator-0.7/build$ make [ 2%] Building C object tpm/CMakeFiles/tpm.dir/tpm_migration.c.o /home/jianglu/tpm_emulator-0.7/tpm/tpm_migration.c: 在函数‘TPM_CMK_ApproveMA’中: /home/jianglu/tpm_emulator-0.7/tpm/tpm_migration.c:385:14: 错误: 变量‘res’被设定但未被使用 [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make[2]: *** [tpm/CMakeFiles/tpm.dir/tpm_migration.c.o] 错误 1 make[1]: *** [tpm/CMakeFiles/tpm.dir/all] 错误 2 make: *** [all] 错误 2希望高手指教,谢谢……哦,是执行到make的时候,不是执行到cmake ../的时候。
1 回答
MMTTMM
TA贡献1869条经验 获得超4个赞
cmake就是使用makefile的
看这一句:cc1: all warnings being treated as errors
You need to remove -Werror from CFLAGS, CPPFLAGS etc.; these are usually set in Makefile's or build scripts.
就是修改makefile,把-Werror去掉
- 1 回答
- 0 关注
- 109 浏览
添加回答
举报
0/150
提交
取消