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 » U++ Library support » Draw, Display, Images, Bitmaps, Icons » How to import iml from other class?
How to import iml from other class? [message #8724] Tue, 27 March 2007 22:37 Go to next message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
How to use .iml from other class?

If I have App.iml defined in App.cpp/hpp and a class Splash.cpp/hpp, what goes there precisely to use App.iml?
The GUI-tutorial answers this question sparsely with remarks about iml_header.h and iml_source.h. But I'm pulling my hairs out trying the put the headers and defines for App.iml in the proper place of Splash class files, going back an forward between undefined and redefined identifiers.

Guido
Re: How to import iml from other class? [message #8726 is a reply to message #8724] Wed, 28 March 2007 09:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12046
Registered: November 2005
Ultimate Member
guido wrote on Tue, 27 March 2007 16:37

How to use .iml from other class?

If I have App.iml defined in App.cpp/hpp and a class Splash.cpp/hpp, what goes there precisely to use App.iml?
The GUI-tutorial answers this question sparsely with remarks about iml_header.h and iml_source.h. But I'm pulling my hairs out trying the put the headers and defines for App.iml in the proper place of Splash class files, going back an forward between undefined and redefined identifiers.

Guido


If you are using images just in single file, just put:

#define  IMAGEFILE  <iml/image.iml>
#define  IMAGECLASS MyImg
#include <Draw/iml.h>


at the beginning.

If you are using it across more files, you will need to declare in header:

#define  IMAGEFILE  <iml/image.iml>
#define  IMAGECLASS MyImg
#include <Draw/iml_header.h>


and also "define somewhere", in some .cpp (but only one!) file:


#define  IMAGEFILE  <iml/image.iml>
#define  IMAGECLASS MyImg
#include <Draw/iml_source.h>


Note this is the same as declaring "extern int myint" in .h and then defining it "int myint" in .cpp.

Mirek
Re: How to import iml from other class? [message #8740 is a reply to message #8726] Wed, 28 March 2007 19:25 Go to previous messageGo to next message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
Yes, I tried this. But then, I need to import Splash.hpp in App.cpp and this results in a redefinition error:

/home/guido/upp/uppsrc/Draw/iml_header.h:13: error: redefinition of ‘class CaterImg’
/home/guido/upp/uppsrc/Draw/iml_header.h:13: error: previous definition of ‘class CaterImg’


I based my app on Werner's template. I deleted the U++ logo file and try to use a big version of the app_icon for the splash image.

Sorry for being dumb Confused

upp is great in many ways, but for all that opaque (to me) preprocessor magic. Feels pretty low-level, for now.
Maybe I get the hang of it and see it differently, then.

Guido
Re: How to import iml from other class? [message #8741 is a reply to message #8740] Wed, 28 March 2007 19:32 Go to previous message
mirek is currently offline  mirek
Messages: 12046
Registered: November 2005
Ultimate Member
guido wrote on Wed, 28 March 2007 13:25

Yes, I tried this. But then, I need to import Splash.hpp in App.cpp and this results in a redefinition error:

/home/guido/upp/uppsrc/Draw/iml_header.h:13: error: redefinition of ‘class CaterImg’
/home/guido/upp/uppsrc/Draw/iml_header.h:13: error: previous definition of ‘class CaterImg’




This looks like the header is being included twice.

Quote:


upp is great in many ways, but for all that opaque (to me) preprocessor magic. Feels pretty low-level, for now.
Maybe I get the hang of it and see it differently, then.



Well, you can have either preprocessor magic, or external tools that do the same job less transparently - you would still have to include something and at least link in something.

BTW, a good way to get hand on it (and also, for us, to debug this stuff) is "Preprocess file" command in the build menu. I think it can help pretty well in this case too.

Mirek
Previous Topic: Loading Image (from HttpClient)
Next Topic: DrawImage with XOR undefined
Goto Forum:
  


Current Time: Mon Oct 14 17:36:27 CEST 2019

Total time taken to generate the page: 0.01350 seconds