XPM图像导致GCC编译器的奇怪警告 不指定 2008/08/02

| |
在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)发帖请教,才知道原来是图像的格式不规范导致的。
解决方法:
引用
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[] = {
Tags: , , , ,
发表评论

昵称

网址

电邮

打开HTML 打开UBB 表情 打开表情 隐藏 记住我 [注册]