Linux shared library Programming
Author: su huaiguang
I. Description
Similar to the dynamic link library in windows, Linux also has a shared library to support code reuse. *. Dll in windows and *. So in Linux. The following describes how to create and use a Linux shared library.
Ii. Create a shared
The library function not only improves the utilization of the code, but also shields the details of the implementation of the function, and provides a unified interface for different developers. From the perspective of implementation, library functions can be divided into dynamic function libraries and static function libraries. The same set of functions that can be encapsulated into static and dynamic libr
First of all, C + + compilation process
Compile: Check the statement symbol definition, and generate the intermediate language for C + + code translation.
Link: Consolidate intermediate code to generate executable binary code.
Simply put, the library file is a special intermediate language file, the static library is also a special format of the archive file (packaged files).To use a stati
If we pack a static library there must be a need for you to pack a library that can be used on a real machine or on a simulator, and how to package and generate a generic static library.
In fact, it is not difficult, first of all, you need to first through the real machine to generate a real machine can use the static librar
IOS Static library, dynamic library and FrameworkThe difference between a static library and a dynamic libraryFirst of all to see what is a library, the library is plainly a compiled binary code, plus a header file can be used by others.When will we use the
OverviewAs with the C language, the language itself does not provide input and output support, and the input and output are done through a standard library. The standard library of C provides a range of functions that can be used to implement input and output, while the C + + standard library provides a range of classes and objects to perform input and output fun
As a professional programmer, we often create a library of tools because of our work needs. The so-called tool Library is a function library composed of a set of functions, which is pre-compiled for some common problems that are often encountered at work. Typically, the functionality of these libraries is implemented by a series of functions around these data typ
First, preface:In the above, the author systematically expounds the two driving modes of 1602, and simply mentions the Liquidcrystal Library of Arduino. In this article, the following two questions are explored in more depth: how can I minimize the 1602-to-Arduino port footprint? How should the Liquidcrystal library learn? Under the Arduino LCD1602 Comprehensive Study (under), the author intends to introduc
Function libraries are classified into static libraries and dynamic libraries.
The static library will be connected to the target code during program compilation. This static library is no longer needed when the program is running.
The dynamic library is not connected to the target code during program compilation, but is loaded only when the program runs. Theref
Tags: mysqlWhen watching the teaching video of the old boy's teacher, talking about the request from the library to send data from the main library, but think about the rationale, if each time the request from the library to update the data, it can not be updated in real time, for some more "quiet" database is also a waste of resources.After grasping the bag expe
first, you need to install the Eclipse's CDT compilation environment. Configure the GCC compilation environment. LUnix usually have GCC, Windows needs to install a Cygwin.
first, establish a dynamic database (. so file)
1. Create a shared library project in eclipse first
File->new->project->c project, select Shared Library, select Empty Project
2, create the project source file Share.cpp
File->new->source
Static libraries: Files in Windows with the suffix. lib, and. a files in Linux;Dynamic libraries: Files with the suffix. dll in Windows, and. so files in Linux;In Windows:Call a static library: Add a static library path-dependent on the static library (or #pragma comment (lib,xx.lib))--Contains header files--and the function in the static
Compile the. a library file used by iOS, and compile the ios. a library
First, the source file to be compiled into.
Hello. h:
#ifndef __INCLUDE_HELLO_H__#define __INCLUDE_HELLO_H__void hello(const char *name);#endif // end __INCLUDE_HELLO_H__
Hello. c
#include "stdio.h"void hello(const char *name){ printf("Hello world %s\n", name);}
1. Use xcode to create a li
note: the following content is based on the posts discussed in csnd and compiled based on your understanding. For reference only. 0) on Windows, the C Runtime Library is as follows: dynamically connects to the static Connection Library of the library import/export file release msvcrt. DLL msvcrt. lib libc. lib (single thread), libcmt. lib (multithreading) deb
The site of the transfer is: http://www.cnblogs.com/fengyv/archive/2012/08/10/2631313.htmlThe type of file under Linux is not dependent on the suffix, but generally:. O, which is the target file, equivalent to the. obj file in Windows. So is a shared object, which is used for dynamically connected, similar to DLLs. A is a static library and is a good number of. O Together for static connection. LA for Libtool auto-generated some shared libraries, vi e
1.Naming rules for static and dynamic libraries in Linux:
Static function library: the static library name is generally libxxx. A. The files generated by static library compilation are large because all the data in the static library will be integrated into the target code.
A)Advantage: After compilation, executable fi
Tags: mysql prompt-o toggle SLA status Other attention emptied1. Master Vault Master OutageSign in from library show Processlist\gSee update status for two threadsmysql> show processlist\G*************************** 1. row *************************** Id: 1 User: system user Host: db: NULLCommand: Connect Time: 22997 State: Waiting for master to send event Info: NULL*************************** 2. row *************************** Id: 2 User:
Reference blog:C + + static library and dynamic library>> Static Library1. Making a static libraryA) Edit name.cpp and name.h filesb) $g + +-C name.cpp // note with parameter - c, or compile directly as an executable filec) $ar-crv libname.a name.o // use ar tool to package the target file into . A static library file2 Use of static librariesA) The header
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.