In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Library:
Using the technology of Library, compiled symbols can be made available to third parties.
There are two types of libraries:
1. Dynamic library Dynamic-Link Library (DLL) (called Shared Library under Linux)
2. Static library Static Library
I. creation and use of dynamic libraries
Create a DLL:
Create a console project of type "dll" with VC, and VC will automatically create a project framework for DLL
It automatically generates a DllMain function, which can be compared to the main function in ordinary applications.
VC project settings:
1. Cancel the "precompiled header file"
2. Change it to "/ MTd compilation"
3. Modify the name of the output DLL (my.dll)
Compile to get * .lib and * .dll, where:
* .dll:
Contains instructions compiled into all the code
* .lib: contains a list of the symbols contained in the table name my.dll and the location of each symbol in the dll. (exported symbol)
So, * .lib is much smaller than the file size of * .dll
If you want to export a global function, declare it with the keyword _ _ declspec (dllexport)
Note: this is a keyword specific to VC platform and is not available on linux platform.
The use is as follows:
Template _ declspec (dllexport) void MySwap (T & obj1, T & obj2) {T tmp = obj1; obj1 = obj2; obj2 = tml;}
Use dll:
# pragma comment (lib, "12_18_DLL01") _ declspec (dllimport) int Add (int a, int b); int main () {int ret = Add (1,2); std::cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.