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 » ImageFile (iml) #include [SOLVED]
Re: ImageFile [message #18960 is a reply to message #18950] Sun, 02 November 2008 16:44 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
sapiency wrote on Sun, 02 November 2008 08:55

hi,

I read the solution for using the images multiple cpp files ..

it says,

using in header:
#define IMAGECLASS NAME
#define IMAGEFILE <pathtofile/images.iml>
#include <Draw/iml_header.h>


and in sources:

#define IMAGECLASS NAME
#define IMAGEFILE <pathtofile/images.iml>
#include <Draw/iml_source.h>


I created one source for my images which I want to use in multiple header and sources. So I put the code for header and for the sources in files, which I include in my other files

#include "images-header.h"

in code1.h and code2.h

#include "images-sources.h"

in code1.cpp and code2.cpp

There were no problems with the compiler, but the linker stopped with errors ... "class NAME" redefined ...

is there a solution to use it in multiple files? It would help to keep the files smaller.

regards

reinhard




Oh, not that complicated. Just put the

#define IMAGECLASS NAME
#define IMAGEFILE <pathtofile/images.iml>
#include <Draw/iml_header.h>


into some header that you include in all files that are using images (this is same as declaring function or class in header) and then put


#define IMAGECLASS NAME
#define IMAGEFILE <pathtofile/images.iml>
#include <Draw/iml_source.h>


into the *ANY* .cpp, but only ONE, that includes the header of the previous step. This is equivalent of defining function.

If you put it to more than single file, it is like defining function twice - that does not work either Wink

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: EXIF data access
Next Topic: Draw was added to plugin/png.
Goto Forum:
  


Current Time: Sat Jun 14 14:10:35 CEST 2025

Total time taken to generate the page: 0.04630 seconds