Fuse program Compilation

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.