C static library *. A compiled with GCC and AR, which isProgramCall and compile with G ++.
1. header file problem: C static library header file must be its header file to be surrounded by extern "C", otherwise the undefined reference problem may occur, refer to: http://blog.csdn.net/xiaoanian/article/details/8841083
2. Structure alignment. Many C libraries operate the struct directly in the memory to improve efficiency. It is okay to run the struct independently after compiling with GCC. However, problems may occur when it is integrated into C ++, by default, G ++ alignment the memory of the struct, which may be different from that of GCC. The solution is to force the structure of the C library not to be aligned: Use # pragma pack (1) and # pragma pack () to enclose the definition of the structure. See http://blog.csdn.net/mannhello/article/details/5384431