QMAKE为DLL添加版本信息
在PRO文件中添加如下代码:
| 1 | win32 { | 
CONFIG += skip_target_version_ext表示生成的dll文件中不添加版本的后缀。
效果如下:
在CPP中获取该版本
在PRO文件中添加宏
| 1 | VERSION = 3.3.0.0 | 
在CPP中使用宏
| 1 | QCoreApplication::setApplicationVersion(QString(APP_VERSION)); | 
在PRO文件中添加如下代码:
| 1 | win32 { | 
CONFIG += skip_target_version_ext表示生成的dll文件中不添加版本的后缀。
效果如下:
在PRO文件中添加宏
| 1 | VERSION = 3.3.0.0 | 
在CPP中使用宏
| 1 | QCoreApplication::setApplicationVersion(QString(APP_VERSION)); |