Use the MAKEFILE file generated by configure to compile all example in fuse directly. However, if you want to compile an example separately or compile your own file system, follow the instructions in this document: gcc-wall 'pkg-config fuse -- cflags -- libs' hello. c-O hello, note that "'" is the button on the upper left corner of the keyboard and on the left side of number 1, rather than single quotation marks. However, the link error "fuse_main_real () function cannot be found…" will be reported during compilation using this command ......" And so on. This is a typical Link error. It means that the compiler only sees the declaration of the function and does not find the implementation of this function. In fact, this function is implemented in helper. C and compiled into the corresponding link library. The reason is actually the order in which GCC command line parameters are passed in. 'Pkg-config fuse -- cflags -- libs' can be understood as a variable defined during fuse installation. You can enter echo in the terminal
'Pkg-config fuse -- cflags -- libs' to view the GCC command line parameters after this variable is expanded, it should be in this form "-d_file_offset_bits64-I/usr/includefuse-pthread-lfuse-LRT = ". It contains a-lfuse command, which is used to link the corresponding link library of fuse, that is, to tell the compiler where to find the implementation of fuse_main_real. In fact, GCC requires that the command line parameters of the Linked Library be placed in Source codeAfter the file is compiled, change the above command to GCC-wall hello. C-O hello 'pkg-config fuse -- cflags -- libs. For more information about GCC parameters, see the official GCC documentation.