如何在make之后运行.o文件

use*_*434 5 c c++ makefile

我一直试图从https://github.com/rinon/Simple-Homomorphic-Encryption运行一个c ++程序

正如README我在运行以下命令中指定的那样,

make

make test

make demo
Run Code Online (Sandbox Code Playgroud)

现在,我的目录中有以下文件,

zakirhussain@zakirhussain-K52F:~/Simple-Homomorphic-Encryption$ ls
circuit.cpp             demo_vote_counter.cpp  fully_homomorphic.cpp  main.o                 security_settings.h     test_suite.o  utilities.o
circuit.h               demo_vote_counter.h    fully_homomorphic.h    makefile               security_settings.o     type_defs.h
circuit.o               demo_vote_counter.o    fully_homomorphic.o    README                 test_fully_homomorphic  utilities.c
demo_fully_homomorphic  fully_homomorphic      main.cpp               security_settings.cpp  test_suite.cpp          utilities.h
Run Code Online (Sandbox Code Playgroud)

有人可以帮助我运行demo_vote_counter.o文件吗?

Dev*_*lus 6

您无法运行.o文件.这是一个目标文件,必须链接到最终的可执行文件中.甲.o文件通常缺乏附加的库,其在该连接阶段加入.

看着你outoput我假设的一个demo_fully_homomorphic,test_fully_homomorphic或者fully_homomorphic是你可以运行可执行文件.


Mar*_*sen 6

一个目标文件.o)是不可执行的。您要运行./demo_fully_homomorphic(例如,不带扩展名的文件)。确保您具有执行权限(chmod a+x demo_fully_homomorphic)。