在Windows平台下用VC编译器时没有任何警告信息,但在Linux下使用GCC编译器时却出现莫名其妙的警告,信息如下:
解决方法:
Compiling: src/main.cpp
In file included from /media/disk/project/pmoney/src/main.cpp:16:
/media/disk/project/pmoney/src/res/new.xpm:50: warning: deprecated conversion from string constant to ‘char*’
/media/disk/project/pmoney/src/res/new.xpm:50: warning: deprecated conversion from string constant to ‘char*’
...
而且警告信息大量重复。上网查询资料,也长不到这个问题的解决,只好到wxWidgets的官方论坛(http://wxforum.shadonet.com)发帖请教,才知道原来是图像的格式不规范导致的。In file included from /media/disk/project/pmoney/src/main.cpp:16:
/media/disk/project/pmoney/src/res/new.xpm:50: warning: deprecated conversion from string constant to ‘char*’
/media/disk/project/pmoney/src/res/new.xpm:50: warning: deprecated conversion from string constant to ‘char*’
...
解决方法:
引用
Look inside your xpms with a text editor and you'll probably find that they start with:
static char * foo[] = {
To keep up with the latest fashion, you need to change this (by hand or by sed) to:
static const char * foo[] = {
static char * foo[] = {
To keep up with the latest fashion, you need to change this (by hand or by sed) to:
static const char * foo[] = {
奇怪的wxImageList错误
让_() 宏、wxGetTranslation支持多行



