(1)DLL项目时没有main入口的,所以你要添加main.cpp,写个main函数,别忘了引用文件和创建对象用于运行。
如果这时候你直接编译,不好意思:unresolved external symbol _WinMain@16
(2)修改项目配置:
a > Configuration Properties 》General》Configuration type》Application(.exe)
b >Configuration Properties 》C/C++》Preprocessor》Preprocessor Definition》删除_WINDOWS,添加_CONSOLE
c >Configuration Properties 》Linker》System》SubSystem》Console (/SUBSYSTEM:CONSOLE)
(3)编译连接运行吧,可爱的孩纸
控制台 转dll项目 同样道理