[英]Compiling an existing C++ program using Makefile
编辑: 尚未解决 ,但是当我转向其他软件时 ,我遇到了其他挑战。
对于一个研究项目,我将用于计算机视觉的Github项目 (Tagliasacchi 等人 ,2015)下载到Linux 16.04。 我有PHP编程经验,但是对C ++不熟悉。 当我尝试在计算机上复制研究结果时 ,我很早就遇到了编译错误。
cmake .
工作正常,并创建了一些文件。 但是, make
不起作用。 g++ [filename].cpp -o main
显然不起作用。 如何解决这个问题并获得正确的依赖关系?
在某些情况下,有一个Makefile,但是我遇到了一个错误:
[ 33%] Building CXX object CMakeFiles/helloworld_atb.dir/main.cpp.o /bin/sh: 1: /usr/bin/g++-4.8: not found CMakeFiles/helloworld_atb.dir/build.make:62: recipe for target 'CMakeFiles/helloworld_atb.dir/main.cpp.o' failed make[2]: *** [CMakeFiles/helloworld_atb.dir/main.cpp.o] Error 127 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helloworld_atb.dir/all' failed make[1]: *** [CMakeFiles/helloworld_atb.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
在其他情况下(例如在跟踪器»HandFinder中),我无法运行cmake .
或使用g++ HandFinder.cpp -o handfinder
make
和编译g++ HandFinder.cpp -o handfinder
不起作用:
In file included from HandFinder.cpp:1:0: HandFinder.h:2:41: fatal error: tracker/ForwardDeclarations.h: No such file or directory compilation terminated.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.