[英]Error message while compiling a program
我是C ++和Linux的新手。 我正在玩的這段代碼要求我安裝執行的HElib(同態加密庫和其他庫-GMP,NTL)。 我想在HElib中編譯具有頭文件( FHE.h
)的代碼( main.cpp
)。 我的問題是如何將FHE.h
(在HElib
文件夾中)和main.cpp
(在另一個文件夾中)鏈接在一起,以便我可以對其進行編譯。 我已經嘗試了一些命令
g++ -I/Home/HElib/src/FHE.h main.cpp -o main
錯誤信息
main.cpp:1:17: fatal error: FHE.h: No such file or directory
compilation terminated.
另一個命令行
g++ -I/Home/HElib/Src/FHE.h -I/Home/SimpleFHESum-master/SimpleFHESum-master/main.cpp -o main]
錯誤信息
g++: fatal error: no input files
compilation terminated.
有什么問題,我該如何解決?
-I
標志將以下目錄添加到編譯器的包含路徑。 這使您可以編寫例如#include "FHE.h"
即使該文件與您要編譯的源文件不在同一文件夾中。
您是否嘗試過從-I指令中刪除“ FHE.h”部分?
g++ -I/Home/HElib/src ...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.