# 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 關注
- 128 瀏覽
添加回答
舉報
0/150
提交
取消