WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: FLTK 1.3.4 Issue  (Read 3258 times)

Offline nimday

  • Jr. Member
  • **
  • Posts: 75
FLTK 1.3.4 Issue
« 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);')

Code: [Select]
#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

Code: [Select]
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

Code: [Select]
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.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
Re: FLTK 1.3.4 Issue
« Reply #1 on: August 09, 2017, 10:41:05 PM »
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.
« Last Edit: August 09, 2017, 11:00:46 PM by polikuo »

Offline nimday

  • Jr. Member
  • **
  • Posts: 75
Re: FLTK 1.3.4 Issue
« Reply #2 on: August 10, 2017, 01:05:36 AM »
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

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
Re: FLTK 1.3.4 Issue
« Reply #3 on: August 10, 2017, 01:47:50 AM »
You should check your environment, did you load compiletc ?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: FLTK 1.3.4 Issue
« Reply #4 on: August 10, 2017, 05:34:36 AM »
Maybe you have fltk 1.1 headers loaded?
The only barriers that can stop you are the ones you create yourself.

Offline nimday

  • Jr. Member
  • **
  • Posts: 75
Re: FLTK 1.3.4 Issue
« Reply #5 on: August 11, 2017, 03:43:04 PM »
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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: FLTK 1.3.4 Issue
« Reply #6 on: August 12, 2017, 04:06:27 AM »
Yes, FLTK was updated after the 8.0 release.
The only barriers that can stop you are the ones you create yourself.

Offline nimday

  • Jr. Member
  • **
  • Posts: 75
Re: FLTK 1.3.4 Issue
« Reply #7 on: August 12, 2017, 11:47:27 AM »
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)
Code: [Select]
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
Code: [Select]
dad425669eea0e4001a80fd7e4d5cfaa  fltk-1.3.tcz
Or, Do you mean after 8.0 like 8.1?
I haven't tried it yet.
« Last Edit: August 12, 2017, 11:55:21 AM by nimday »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
Re: FLTK 1.3.4 Issue
« Reply #8 on: August 12, 2017, 11:53:19 AM »
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.

Offline nimday

  • Jr. Member
  • **
  • Posts: 75
Re: FLTK 1.3.4 Issue
« Reply #9 on: August 12, 2017, 12:02:37 PM »
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.