GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Oct-2007, 21:14
Invincible Invincible is offline
New Member
 
Join Date: Jul 2007
Posts: 23
Invincible is on a distinguished road

Fl_PNG_Image undefined reference


Hi everbody,

I am using fltk-1.1.7 , and i have configured it using --enable-threads and --enable-localpng but when I am trying to load png image using Fl_PNG_Image it is giving undefined reference

CPP / C++ / C Code:
In function `Fl_PNG_Image::Fl_PNG_Image(char const *)':
Fl_PNG_Image.o(.text+0x88): undefined reference to `png_create_read_struct'
Fl_PNG_Image.o(.text+0x90): undefined reference to `png_create_info_struct'
Fl_PNG_Image.o(.text+0xc8): undefined reference to `png_init_io'
Fl_PNG_Image.o(.text+0xd4): undefined reference to `png_read_info'
Fl_PNG_Image.o(.text+0xec): undefined reference to `png_set_expand'
Fl_PNG_Image.o(.text+0x148): undefined reference to `png_set_packing'
Fl_PNG_Image.o(.text+0x150): undefined reference to `png_set_expand'
Fl_PNG_Image.o(.text+0x178): undefined reference to `png_set_strip_16'
Fl_PNG_Image.o(.text+0x1fc): undefined reference to `png_set_interlace_handling'
Fl_PNG_Image.o(.text+0x220): undefined reference to `png_read_rows'
Fl_PNG_Image.o(.text+0x244): undefined reference to `png_read_end'
Fl_PNG_Image.o(.text+0x254): undefined reference to `png_destroy_read_struct'

I am stuck with this can anyone help me
__________________
Everything you see is a Dream...
  #2  
Old 17-Oct-2007, 22:22
Invincible Invincible is offline
New Member
 
Join Date: Jul 2007
Posts: 23
Invincible is on a distinguished road

Re: Fl_PNG_Image undefined reference


Problem is solved it was an error in make file
__________________
Everything you see is a Dream...
  #3  
Old 22-Jun-2008, 10:15
kyramoon kyramoon is offline
New Member
 
Join Date: Jun 2008
Posts: 2
kyramoon is on a distinguished road

Re: Fl_PNG_Image undefined reference


Hi, can you tell about the problem and how you solved it?
I have a similar problem:
Code:
/tmp/cc9LPK7k.o: In function `__static_initialization_and_destruction_0(int, int)': coloca_4_copia.cxx:(.text+0x12a): undefined reference to `Fl_PNG_Image::Fl_PNG_Image(char const*)' coloca_4_copia.cxx:(.text+0x154): undefined reference to `Fl_PNG_Image::Fl_PNG_Image(char const*)'

Thanks
  #4  
Old 24-Jun-2008, 20:57
Invincible Invincible is offline
New Member
 
Join Date: Jul 2007
Posts: 23
Invincible is on a distinguished road

Re: Fl_PNG_Image undefined reference


First you have to tell me which version you are using ?

If you are using fltk-1.1.7 ,just check your configuration .You need to configure your FLTK with PNG

I think this should work for you .

------------
good luck
__________________
Everything you see is a Dream...
  #5  
Old 11-Feb-2009, 14:06
Newhunter Newhunter is offline
Awaiting Email Confirmation
 
Join Date: Jan 2009
Location: Rio de Janeiro, Brasil
Posts: 11
Newhunter will become famous soon enough

Re: Fl_PNG_Image undefined reference


May you help me?

I am using FLTK 1.1.9 and I am trying to use PNG or JPEG images.

I already included the required libraries.

CPP / C++ / C Code:
GroupNovoImage = new Fl_Group(0,0,155,385);
	 GroupNovoImage->box(FL_GTK_UP_BOX);
	 fl_register_images(); 
	 Fl_PNG_Image png("mercurium01.png"); 
	 GroupNovoImage->image(png);
	 GroupNovoImage->end();

I've got the following error:

Code:
1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_destroy_read_struct referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_read_end referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_read_rows referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_set_interlace_handling referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_set_tRNS_to_alpha referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_get_valid referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_set_strip_16 referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_set_packing referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_set_expand referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_read_info referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_init_io referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_create_info_struct referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>fltkimagesd.lib(Fl_PNG_Image.obj) : error LNK2019: unresolved external symbol _png_create_read_struct referenced in function "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) 1>C:\Documents and Settings\x\Meus documentos\Visual Studio 2005\Projects\Projeto_Modificado\Debug\Projeto.exe : fatal error LNK1120: 13 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\x\Meus documentos\Visual Studio 2005\Projects\Projeto_Modificado\Projeto\Debug\BuildLog.htm" 1>Projeto - 14 error(s), 0 warning(s)

What should I do to solve this problem?
  #6  
Old 11-Feb-2009, 15:50
Newhunter Newhunter is offline
Awaiting Email Confirmation
 
Join Date: Jan 2009
Location: Rio de Janeiro, Brasil
Posts: 11
Newhunter will become famous soon enough

Re: Fl_PNG_Image undefined reference


I am using Visual Studio 2005 and I included the libraries:

fltkd.lib fltkjpegd.lib fltkimagesd.lib fltkzd.lib wsock32.lib comctl32.lib

Is there another library that I should include??
  #7  
Old 12-Feb-2009, 09:17
Newhunter Newhunter is offline
Awaiting Email Confirmation
 
Join Date: Jan 2009
Location: Rio de Janeiro, Brasil
Posts: 11
Newhunter will become famous soon enough

Re: Fl_PNG_Image undefined reference


I solved this problem. It was because I forgot to include the fltkpngd.lib library.

But now, I've got a runtime error.

This code is compiling.

CPP / C++ / C Code:
 GroupNovoImage = new Fl_Group(0,0,155,385);
	 GroupNovoImage->box(FL_GTK_UP_BOX);
	 Fl_Box *box = new Fl_Box(0,0,155,385);
	 fl_register_images(); 
	 Fl_PNG_Image png("c:/Mercurium01.png"); 
	 box->image(png);
	 GroupNovoImage->end();

But the image isn't being loaded in the box. I've got this message:

Unhandled exception at 0x8910558b in Project.exe: 0xC0000005: Access violation reading location 0x8910558b.

And the program breaks because it can't import the image.

My question is: How should I import this image? The way I did is correct?

cheers,

Newhunter
  #8  
Old 12-Feb-2009, 18:33
Newhunter Newhunter is offline
Awaiting Email Confirmation
 
Join Date: Jan 2009
Location: Rio de Janeiro, Brasil
Posts: 11
Newhunter will become famous soon enough

Re: Fl_PNG_Image undefined reference


I found the problem!

Now it is working:

CPP / C++ / C Code:
 GroupNovoImage = new Fl_Group(0,0,155,385);
	 GroupNovoImage->box(FL_GTK_UP_BOX);
	 Fl_Box *box = new Fl_Box(0,0,155,385);
	 fl_register_images();
	 Fl_PNG_Image *png = new Fl_PNG_Image("Mercurium01.png"); 
	 box->image(png);
	 GroupNovoImage->end();

I created a pointer of Fl_PNG_Image class because the image parameter should be a pointer. Now it is working very well.
  #9  
Old 22-Aug-2009, 13:57
uitrix uitrix is offline
New Member
 
Join Date: Aug 2009
Posts: 1
uitrix is on a distinguished road

Re: Fl_PNG_Image undefined reference


Please, help me with this problem.. Still, I misunderstand why doesn't it working, when I'm trying to use this.. (And sorry for my bad eng ^^)

Trying to do this:

CPP / C++ / C Code:
fl_register_images();
Fl_PNG_Image * png = new Fl_PNG_Image("c:/asd.png");

And have this:

Code:
1>classes.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_PNG_Image::Fl_PNG_Image(char const *)" (??0Fl_PNG_Image@@QAE@PBD@Z) referenced in function "public: __thiscall CStart_Window::CStart_Window(void)" (??0CStart_Window@@QAE@XZ) 1>classes.obj : error LNK2019: unresolved external symbol "void __cdecl fl_register_images(void)" (?fl_register_images@@YAXXZ) referenced in function "public: __thiscall CStart_Window::CStart_Window(void)" (??0CStart_Window@@QAE@XZ)

Included libraries:
fltkd.lib wsock32.lib comctl32.lib fltkpngd.lib

I'm new in fltk, and do not know it well.. So, can't understand, why this happens =)
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two-Tier data dissemination code installation problem nidhibansal1984 Computer Software Forum - Linux 6 16-Sep-2007 10:13
linker error unpep FLTK Forum 4 15-Apr-2007 03:03
gnu.linkonce undefined reference newbie06 C++ Forum 4 13-Mar-2007 09:53
c++ inheritance illbemissingu C++ Forum 14 23-Oct-2005 17:35
fltk-2.0 cvs Plumb FLTK Forum 20 13-Nov-2004 07:10

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 14:38.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.