(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项目 同样道理
本文详细介绍了如何将DLL项目转换为可独立运行的EXE应用,包括添加main函数、配置项目属性以及解决unresolved external symbol错误的具体步骤。
345

被折叠的 条评论
为什么被折叠?



