Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Usage of Iml image data leads to linker error (If a static image is used, I cannot access it, e.g. assign the image to draw it)
Usage of Iml image data leads to linker error [message #45441] Sat, 14 November 2015 14:30 Go to next message
SevenOfNine is currently offline  SevenOfNine
Messages: 4
Registered: November 2015
Junior Member
I assume it is a simple error on my side but ok.
If I draw an image with the image designer and
want to access the image e.g. to draw it on the application window
the compiler compiles it but the linker reported, that he does not find the reference:
"Nicht definierter Verweis auf 'SmallIconImg::Get(int)'"
means "Not defined reference on 'SmallIconImg::Get(int)'"

The main stuff of the programm is:

#define IMAGECLASS SmallIconImg
#define IMAGEFILE <DrawApp/SmallIcon.iml>
#include <Draw/iml_header.h>

and
void DrawApp::Paint(Draw& w)
{

    w.DrawRect(GetSize(), SColorFace());
    w.DrawImage(50, 50, SmallIconImg::Point());
}


I use the example from ...www.ultimatepp.org/srcdoc$Draw$ImgTutorial$en-us....
as template.
Shocked
I do not know, what I forgot to add.

Has anybody an idea about my mistake?

Can you help me?
Seven
Re: Usage of Iml image data leads to linker error [message #45443 is a reply to message #45441] Sat, 14 November 2015 17:07 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
SevenOfNine wrote on Sat, 14 November 2015 14:30
I assume it is a simple error on my side but ok.
If I draw an image with the image designer and
want to access the image e.g. to draw it on the application window
the compiler compiles it but the linker reported, that he does not find the reference:
"Nicht definierter Verweis auf 'SmallIconImg::Get(int)'"
means "Not defined reference on 'SmallIconImg::Get(int)'"

The main stuff of the programm is:

#define IMAGECLASS SmallIconImg
#define IMAGEFILE <DrawApp/SmallIcon.iml>
#include <Draw/iml_header.h>

and
void DrawApp::Paint(Draw& w)
{

    w.DrawRect(GetSize(), SColorFace());
    w.DrawImage(50, 50, SmallIconImg::Point());
}


I use the example from ...www.ultimatepp.org/srcdoc$Draw$ImgTutorial$en-us....
as template.
Shocked
I do not know, what I forgot to add.

Has anybody an idea about my mistake?

Can you help me?
Seven


Most likely "iml_source.h" include.

"iml_header.h" creates just declarations and is supposed to be in header. Real data are "inserted" by

#define IMAGECLASS SmallIconImg
#define IMAGEFILE <DrawApp/SmallIcon.iml>
#include <Draw/iml_source.h>


which should be in some .cpp file.
Re: Usage of Iml image data leads to linker error [message #45444 is a reply to message #45443] Sat, 14 November 2015 23:38 Go to previous messageGo to next message
SevenOfNine is currently offline  SevenOfNine
Messages: 4
Registered: November 2015
Junior Member
Hello Mirek,
thanks for the fast answer, but I'm sorry, it doesn't help. Confused
If I replace "#include <Draw/iml_header.h>" by "<Draw/iml_source.h>" it doesn't help.
If I add "#include <Draw/iml_source.h" it doesn't help too.
In both cases I get compiler errors.
Let me just provide you my 'configuration information':
theide is installed under Ubuntu 15.4
Have you got another idea or which information do you need too?

Re: Usage of Iml image data leads to linker error [message #45445 is a reply to message #45444] Sun, 15 November 2015 00:07 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
You need to have iml_header in .h AND iml_source in .cpp.

(Or, if you have just single file using iml, you can do #include "iml.h" instead).

If you still have problems, just .zip the package and post as attachement, I will fix it for you Smile

Mirek
Re: Usage of Iml image data leads to linker error [message #45449 is a reply to message #45445] Sun, 15 November 2015 18:32 Go to previous messageGo to next message
SevenOfNine is currently offline  SevenOfNine
Messages: 4
Registered: November 2015
Junior Member
Hello Mirek,
thank you very much Very Happy
Your proposed solution:
----> (Or, if you have just single file using iml, you can do #include "iml.h" instead).
works fine.

However your solution with inclusion of iml_header.h in my header file and inclusion of iml_source.h in the CPP-file
leads (still) to compiler warning (or I make sth. wrong Confused )

Nevertheless thank you for your help.

Seven
Re: Usage of Iml image data leads to linker error [message #45457 is a reply to message #45449] Tue, 17 November 2015 22:20 Go to previous message
SevenOfNine is currently offline  SevenOfNine
Messages: 4
Registered: November 2015
Junior Member
Hello Mirek,
thank you that you have send me the files which solve the problem.
Now I have discovered my general problem.
You have proposed to include iml_source.h, but this will not work because
I have not understood, that the inclusion needs also the two lines above:
#define IMAGECLASS SmallIconImg
#define IMAGEFILE <DrawApp/SmallIcon.iml>
#include <Draw/iml_source.h>

This seems to be a unit and if I miss any of the three lines it does not work.

I try several alternatives.
So I moves the inclusion of "iml_header.h" from the header file (DrawApp.h) to the c-file (DrawApp.c).
This works too, but only if all 3 lines per inclusion are added in this way:

#define IMAGECLASS SmallIconImg
#define IMAGEFILE <DrawApp/SmallIcon.iml>
#include <Draw/iml_header.h>

#define IMAGECLASS SmallIconImg
#define IMAGEFILE <DrawApp/SmallIcon.iml>
#include <Draw/iml_source.h>


My misunderstanding:
It was not clear for me, that the inclusion of iml_header.h or iml_source.h needs the 2 defines in front of its inclusion.
Althought the defines are entered in front of iml_header.h-inclusion,
both defines needs to be entered in front of iml_source.h-inclusion too.
Now: Understood!

Best Regards
Seven


Previous Topic: SqlVal to int (Typecast)
Next Topic: Printer's dialog shows up multiple times
Goto Forum:
  


Current Time: Fri Mar 29 13:46:50 CET 2024

Total time taken to generate the page: 0.01386 seconds