Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: nimday on August 09, 2017, 10:24:53 PM
-
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.
-
I don't have any 32-bit machine around me ATM.
But your code compiles and runs on TC 64 with fltk-1.3-dev.
-
Thanks Man :)
Can you please uncomment these lines like this:
Fl_Pixmap icon1(ico);
box1->image(&icon1);
Fl_RGB_Image icon2(buff,14,14,3);
icon2.color_average(FL_BLUE, 0.0);
box2->image(&icon2);
And please try again.
It's should be red and blue box
Btw, it takes some time to load this site
-
You should check your environment, did you load compiletc ?
-
Maybe you have fltk 1.1 headers loaded?
-
You should check your environment, did you load compiletc ?
Thanks again :)
Manually, Because i only have a tiny modem and sometimes on/off :(
Maybe you have fltk 1.1 headers loaded?
Yes, Maybe missmatch libraries and outdated compile tools.
I just downloaded the latest gcc,binutils,fltk,etc from 8x
There is a different between fltk from 8.0 iso and from 8x repo(440kb and 448kb)
I'm browsing from win at the moment, going to try it later.
-
Yes, FLTK was updated after the 8.0 release.
-
It's ok, red and blue :)
Yes, FLTK was updated after the 8.0 release.
I think it hasn't been updated.
This is from 8.0 (http://tinycorelinux.net/8.x/x86/release/TinyCore-8.0.iso)
6d342fa56a3a138d650a40f916df4d53 fltk-1.3.tcz
And this one from repo
http://distro.ibiblio.org/tinycorelinux/8.x/x86/tcz/fltk-1.3.tcz.md5.txt
dad425669eea0e4001a80fd7e4d5cfaa fltk-1.3.tcz
Or, Do you mean after 8.0 like 8.1?
I haven't tried it yet.
-
FYI
The fktk-1.3 in the 8.0 TinyCore-current.iso is 1.3.3
The latest one is 1.3.4-1
If you don't perform system update,
you'll probably be using the old one as tce-load doesn't update a package for you.
-
FYI
The fktk-1.3 in the 8.0 TinyCore-current.iso is 1.3.3
The latest one is 1.3.4-1
If you don't perform system update,
you'll probably be using the old one as tce-load doesn't update a package for you.
So, that's why different
I guess manual download sucks ;D
Problem solved.