“executable:command not found”虽然“make executable”成功了

时间:2015-06-29 09:36:53

标签: linux ubuntu makefile

我正在尝试安装名为MFOC的工具。我按照其网站上提到的说明进行了操作:

ebrahim@ubuntu:~$ cd Desktop/mfoc-master/

ebrahim@ubuntu:~/Desktop/mfoc-master$ sudo automake
[sudo] password for ebrahim: 

ebrahim@ubuntu:~/Desktop/mfoc-master$ sudo autoconf

ebrahim@ubuntu:~/Desktop/mfoc-master$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libnfc... yes
checking for inline... inline
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for size_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

ebrahim@ubuntu:~/Desktop/mfoc-master$ make
make  all-recursive
make[1]: Entering directory `/home/ebrahim/Desktop/mfoc-master'
Making all in src
make[2]: Entering directory `/home/ebrahim/Desktop/mfoc-master/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/ebrahim/Desktop/mfoc-master/src'
make[2]: Entering directory `/home/ebrahim/Desktop/mfoc-master'
make[2]: Leaving directory `/home/ebrahim/Desktop/mfoc-master'
make[1]: Leaving directory `/home/ebrahim/Desktop/mfoc-master'

ebrahim@ubuntu:~/Desktop/mfoc-master$ mfoc -h
No command 'mfoc' found, did you mean:
 Command 'moc' from package 'qtchooser' (main)
 Command 'mdoc' from package 'monodoc-base' (main)
mfoc: command not found
ebrahim@ubuntu:~/Desktop/mfoc-master$ 

如上所述,似乎make命令存在问题,之后我无法使用该工具。我该如何处理这个问题?

1 个答案:

答案 0 :(得分:1)

简单明了mfoc查看PATH中的目录,这些目录中没有(也不应该)包含当前目录。

如果当前目录中有要运行的工具,请指定路径。当前目录的相对路径只是./

./mfoc

更一般地说,要在不在PATH中的目录中运行工具,请指定该目录的(相对或绝对)路径;

../mfoc-master/mfoc   # look in "mfoc-master" within the parent dir (..)
~/Desktop/mfoc-master/mfoc   # relative to home dir (~)
/home/ebrahim/Desktop/mfoc-master/mfoc   # absolute path

如果您希望在PATH中安装该工具,则命令make install通常会这样做。

相关问题