Static library written in C ++ program

xiaoxiao2021-03-06  84

Static library written in C program

Xiaoxi has been engaged in the development of C under UNIX, soon, because of the needs of the project, you need to use the standard library provided by C to solve some problems. Although the shrimps have been exposed to C , but really use it to compile the large program or the first time, so it is not exempted to meet some mentally issues, maybe for prawn, this is not worth mentioning, but I still want to put it. It records because some people do these most basic things like me on the road.

The people programmed under UNIX will have some of their own packages, packaging into static (* .a) or dynamic library (* .so) to reuse in the future code writing (a little question outside, I personally I feel that a far-signed company should have something like this. These daily accumulated commonly used function packages are the API libraries across a commonly used UNIX platform, such as: Linux, Saloris, AIX, HP-UX, etc .; As Java API, huh, huh ~~~~~; Whether it is with C or C to pack, the shrimp has been doing this, and a small static function library is maintained above the results of the former people, each Subsence, there is a better function and may be used in the future, it will be organized into the commonly used function library. At the same time, it is sorted out the document. Now this library has a bit size, but it is not perfect, I will continue to improve it. Consider using C packages in the future ..... haha ​​runs far .....).

This time, because of the use of C writing programs, it is mainly because the C standard library provides MAP this good stuff, some people have to say that C can also be implemented, of course, good. However, the standard library performance and stability of C are of course guaranteed. In addition, the level and time of Xiaoxi can only borrow C , haha. In this way, the C program needs to call the original common C library function, and I started to connect directly to the static function library in makefile in makefile, but compile the error message display: The static library function called the call: Declare, check the book, but it needs this statement:

EXTERN "C" {int func (...); ......}

This trial is really effective, haha, it is so simple. The shrimp is further step.

--- The world laughs, I am also mad, I laughed from people to see ---

转载请注明原文地址:https://www.9cbs.com/read-98341.html

New Post(0)