Create a dynamic link library (dll) for Windows & Eclipse & CDT & MinGW)
Address: http://blog.csdn.net/caroline_wendy
Eclipse CDT + MinGW create dynamic link library (dll ).
1. Create a dynamic link library project
Select Shared Library: Empty Project-> MinGW GCC
2. Create an export Function
/** Say. cpp ** Created on: April 16, 2014 * Author: Spike */# include <iostream> # include <string> void say (std: string _ name) {std :: cout <_ name <std: endl ;}
3. Generate a dynamic link library
4. Create a called Project
Select Executable: Empty Project-> MinGW GCC
5. Create a primary function
/** Testsay. cpp ** Created on: April 16, 2014 * Author: Spike */# include <iostream> # include <string> void say (std: string _ name); int main () {std: string name ("Caroline"); say (name); return 0 ;}
6. Import the dynamic link library
In the project properties, add the library location.
7. Copy the dynamic link library
8. Run
Caroline