Android Deep Explore eighth chapter

Source: Internet
Author: User

When compiling multiple source code files in the C or C + + language, if A.C uses the functions in the B.C file, you need to use extern to pre-define the functions in B.C in the A.c file, and extern is to tell the compiler the function name, the number of arguments, the parameter type, and the return value type. This information is sufficient for compiling A.C into A.O. When the A.O,B.O is linked to an executable file or library, the compiler then looks for a specific implementation of the function in B.O. That is, extern only works in the compile phase. In addition, you can also use B.h to define the functions in B.C, and then include B.h files in A.C. You can omit the extern keyword for some c/+ + compilers.

Consolidating individual files to form Linux drives, writing makefile files is the most critical step. If the Linux driver has only one source code file, the value of the OBJ-M variable can be the same as the source code file. If the Linux driver contains multiple files, you will need to use Module-y to specify all the target files. You cannot specify only the referenced target file.

In some cases, there may be exceptions to the program, and Linux drivers may not be able to unload properly. Dynamic Linux modules can be uninstalled from memory by restarting the emulator or the Development Board. But if you have to restart the machine every time you can't unload the drive, it's too much trouble. Of course, not all of them can be solved. Only the initialization function of the crash or unload function is blocked to a certain way to solve.

Android Deep Explore eighth chapter

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.