Clang command parameters:

-x: specifies the language type for compiling files. -g: generates debugging information. -C: generates object files, running preprocess, compile, assemble without linking. 2. -l <dir> Specifies the path of the library file (.a\.dylib library file) corresponding to Xcode -l<library_name> specifies the library file name (. A \. Dylib library file) corresponding to other Link flags in Xcode Setting Eg: -lafnetworking -f <directory> Search path -framework <framework_name> Other Link Flags EG :- Framework AFNetworking in the Xcode SettingCopy the code

Clang to compile.m files into.o files:

Clang-x objective-c-target x86_64-apple-Macos11.1-fobjc-arc-isysroot / Applications/Xcode. App/Contents/Developer/Platforms/MacOSX platform/Developer/SDKs/MacOSX11.1 SDK - c filename. M - o filename.oCopy the code

Clang compiles the.o file link library to an executable file:

Clang-target x86_64-apple-Macos11.1-fobjc - arc-isysroot / Applications/Xcode. App/Contents/Developer/Platforms/MacOSX platform/Developer/SDKs/MacOSX11.1 SDK - l. / AFNetworking - L AFNetworking filename.o -o filenameCopy the code

Libtool generates static libraries:

libtool -static -o <OUTPUT NAME> <LIBRARY_1> <LIBRARY_2>
Copy the code

Clang Link Framework:

Clang-target x86_64-apple-Macos11.1-fobjc - arc-isysroot / Applications/Xcode. App/Contents/Developer/Platforms/MacOSX platform/Developer/SDKs/MacOSX11.1 SDK - F/Frameworks \ -framework TestExample filename.o -o filenameCopy the code