Hello,I have little problem with this.
I can load external image, but i can't create internal image.
I tried dynamic & static.
Please uncomment to see the result ('//Fl_Pixmap icon1(ico);')
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Image.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_PNG_Image.H>
static const char *ico[] = {
"14 14 1 1",
"# c #ff0000",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
"##############",
};
int main() {
Fl_Double_Window *win = new Fl_Double_Window(100,100);
Fl_Box* box1 = new Fl_Box(10,10,14,14);
box1->box(FL_UP_BOX);
box1->color(FL_BLACK);
//Fl_Pixmap icon1(ico);
//box1->image(&icon1);
Fl_Box* box2 = new Fl_Box(30,10,14,14);
box2->box(FL_UP_BOX);
box2->color(FL_WHITE);
uchar buff[14*14*3];
//Fl_RGB_Image icon2(buff,14,14,3);
//icon2.color_average(FL_BLUE, 0.0);
//box2->image(&icon2);
Fl_Box* box3 = new Fl_Box(60,10,32,32);
Fl_Image *img=new Fl_PNG_Image("/usr/local/share/pixmaps/aterm.png");
box3->image(img);
win->show();
return(Fl::run());
}
Before
tc@box:~$ cd /tmp
tc@box:/tmp$ fltk-config --use-images --compile test1.cpp
g++ -I/usr/local/include -march=i486 -mtune=i686 -Os -s -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -o 'test1' 'test1.cpp' /usr/local/lib/libfltk_images.a -lpng -lz -ljpeg /usr/local/lib/libfltk.a -lXext -lpthread -ldl -lm -lX11
After
tc@box:/tmp$ fltk-config --use-images --compile test1.cpp
g++ -I/usr/local/include -march=i486 -mtune=i686 -Os -s -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -o 'test1' 'test1.cpp' /usr/local/lib/libfltk_images.a -lpng -lz -ljpeg /usr/local/lib/libfltk.a -lXext -lpthread -ldl -lm -lX11
/tmp/ccxUANji.o: In function `main':
test1.cpp:(.text.startup+0x62): undefined reference to `Fl_Image::Fl_Image(int, int, int)'
test1.cpp:(.text.startup+0xf6): undefined reference to `Fl_RGB_Image::Fl_RGB_Image(unsigned char const*, int, int, int, int)'
collect2: error: ld returned 1 exit status
I hope it's just me.
Thanks.