When you build a program under Linux, you first need to compile it into an. o file, followed by a link. An undefined application error occurs when linking, and the root cause is that the function cannot be found, but there are several possibilities for the phenomenon:
1. The function name in the source program is inconsistent, let's say A.C is a function, when the B file is called, the A1 will cause the function to be found.
2. When the linked O file is not in a folder, you also need to consider the path input is not correct, the principle is similar to the first one.
3 when linking. o The file is in the wrong order, and because of dependencies between function calls, improper link order can also cause undefined appearance.
4. When using makefile for large-program compilation links, similar to the third possible cause, it is possible that the order of the linked libraries is not defined as a result of improper ordering. For example, the main program needs static link X.A,Y.A,Z.A, while x.a needs the function in Z.a, the makefile should be written as follows:
MAIN_LDADD=Z.A x.a y.a rather than x.a,y.a,z.a;
There are no defined application solutions for the link under Linux