How to create your library 井民全製作
Select a library type Win32 Dynamic-Link Library Win32 Static Library 1 2
井民全製作 Win32 Static Library: Add your C++ source file If you want to create a new function File -> New -> Files
井民全製作 Write your function Create your static library
井民全製作 Test your library Create a new project Setup the include directories
井民全製作 Test your library Setup the library directories Where is your library Link Tab
井民全製作 Test your library Add the library General added your library
井民全製作 Write your testing code Since “ the setting of include directory” Since “ the setting of library”
井民全製作 W32 Dynamic-Link Library New a DLL project Write your function code Testing
井民全製作 New a DLL project Create a DLL that exports some symbols 1. Class example 2. Variable example 3. Function example DynamicDemo.cpp
井民全製作 Write your function code getMax function Building DLL: Build –DynamicDemo.dll & DynamicDemo.lib DynamicDemo.cppDynamicDemo.h prototype getMax function
井民全製作 Test your code 1.Create a new project 2.Setup the Include & Library directories 3.Add the DLL library Library directories
井民全製作 #include using namespace std; #include // 注意 : 你要把 DynamicDemo.dll 放到可搜尋到的位置 void main(){ cout << "Max "<< getMax(2, 3); } Test your code Write testing code 你必須要把 DLL 放在可搜 尋的位置 如 :system32 目錄中
井民全製作 End