编译时打印宏变量内容

1
2
3
4
5
6
7
8
9
#define PRINT_MACRO_HELPER(_x) #_x
#define PRINT_MACRO(_x) #_x " = " PRINT_MACRO_HELPER(_x)
 
#define DEFINED_PI 3.14
#define DEFINED_NULL
#pragma message(PRINT_MACRO(DEFINED_PI))
#pragma message(PRINT_MACRO(DEFINED_NULL))
#pragma message(PRINT_MACRO(UNDEFINED))
//#error print stop here.

refer to: https://blog.csdn.net/xshbx/article/details/7981564

qt5.6编译后运行designer

直接双击运行bin/designer.exe会报如下错误:

This application failed to start because it could not find or load the Qt platform plugin "windows" in ...

解决办法是,在bin目录中新建qt.conf文件,其内容如下:

1
2
[Paths]
Prefix=d:/qt5.6.1.x64/

其中d:/qt5.6.1.x64/是根目录,该目录直接下面是bin目录及plugins目录。同时要注意这里的路径字符串中是Linux下的斜杠,不是Windows的反斜杠。