Marco Monacelli
TIps of the day:XPM compile warning 
Sunday, August 31, 2008, 07:09 PM
Posted by Administrator
SO: All posix
Type: Resource Compilation
Language: C\C++
Title: XPM compile warning


Recently with new versions of gcc, when trying to compile an image XPM, at compile time you receive the following error:

warning: deprecated conversion from string constant to `char*

Solution:

This is because some image editor save the xpm images as struct of char pointers, for remove warning simply edit a XPM image and change the struc as follows:

/* XPM */
static char * myimage_xpm[] = {

to

static const char * myimage_xpm[] = {

add comment ( 1 view )   |  permalink   |   ( 2.9 / 522 )

<Back | 1 | 2 | 3 | Next> Last>>