Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to create your library 井民全製作. Select a library type  Win32 Dynamic-Link Library  Win32 Static Library 1 2.

Similar presentations


Presentation on theme: "How to create your library 井民全製作. Select a library type  Win32 Dynamic-Link Library  Win32 Static Library 1 2."— Presentation transcript:

1 How to create your library 井民全製作

2 Select a library type  Win32 Dynamic-Link Library  Win32 Static Library 1 2

3 井民全製作 Win32 Static Library: Add your C++ source file  If you want to create a new function File -> New -> Files

4 井民全製作 Write your function Create your static library

5 井民全製作 Test your library  Create a new project  Setup the include directories

6 井民全製作 Test your library  Setup the library directories Where is your library Link Tab

7 井民全製作 Test your library  Add the library General added your library

8 井民全製作 Write your testing code Since “ the setting of include directory” Since “ the setting of library”

9 井民全製作 W32 Dynamic-Link Library  New a DLL project  Write your function code  Testing

10 井民全製作 New a DLL project  Create a DLL that exports some symbols 1. Class example 2. Variable example 3. Function example DynamicDemo.cpp

11 井民全製作 Write your function code  getMax function  Building DLL: Build –DynamicDemo.dll & DynamicDemo.lib DynamicDemo.cppDynamicDemo.h prototype getMax function

12 井民全製作 Test your code 1.Create a new project 2.Setup the Include & Library directories 3.Add the DLL library Library directories

13 井民全製作 #include using namespace std; #include // 注意 : 你要把 DynamicDemo.dll 放到可搜尋到的位置 void main(){ cout << "Max "<< getMax(2, 3); } Test your code  Write testing code 你必須要把 DLL 放在可搜 尋的位置 如 :system32 目錄中

14 井民全製作 End


Download ppt "How to create your library 井民全製作. Select a library type  Win32 Dynamic-Link Library  Win32 Static Library 1 2."

Similar presentations


Ads by Google