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 #define/#include correctly the .iml file
how to #define/#include correctly the .iml file [message #3431] Wed, 24 May 2006 21:52 Go to next message
forlano is currently offline  forlano
Messages: 1071
Registered: March 2006
Location: Italy
Experienced Contributor
This topic is connected with another post where I signaled that linux wont compile. The problem is in the #define and #include of .iml that perhaps work under windows for the wrong reason.

I've vegamain.h that is included everywhere except in optionImage.cpp. Here it is vegamain.h:
...
#include <Vega3/OptionImage.h>
#include <Vega3/TwoCtrl.h>

#define IMAGECLASS    Vega3Img    
#define IMAGEFILE     <Vega3/Vega.iml>
#include <Draw/iml.h>
...

OptionImage.h, that is included only in optionImage.cpp, read:
...
#define IMAGEFILE <Vega3/Vega.iml>
#include <Draw/iml_header.h>
...

and then main.cpp where I've
#include "VegaMain.h"
...
#define IMAGEFILE <Vega3/Vega.iml>
#include <Draw/iml_source.h>
...

All this work under windows for unknown reasons for me. But I suspect it is even wrong and under linux produce complain. Can somebody (I know who Smile ) confirm that all these cross define/include are correct?
Thank you.

Luigi

[Updated on: Wed, 24 May 2006 21:54]

Report message to a moderator

Re: how to #define/#include correctly the .iml file [message #3433 is a reply to message #3431] Wed, 24 May 2006 22:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Wrong.

"iml.h" is just combination of "iml_header.h" and "iml_source.h" - means it causes troubles if you have any of them (duplicite symbols).

Also, repeat CLASSNAME define for any include.

Mirek

Re: how to #define/#include correctly the .iml file [message #3448 is a reply to message #3433] Thu, 25 May 2006 19:03 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1071
Registered: March 2006
Location: Italy
Experienced Contributor
luzr wrote on Wed, 24 May 2006 22:39

Wrong.

"iml.h" is just combination of "iml_header.h" and "iml_source.h" - means it causes troubles if you have any of them (duplicite symbols).

Also, repeat CLASSNAME define for any include.

Mirek



Thank you. After many tests I've resolved the problem and now even the linux version works Very Happy . Perhaps maybe useful to let know how I've distributed the define and include:

vegamain.h (stay everywhere in each cpp file)
 ...
#define IMAGECLASS    Vega3Img  
#define IMAGEFILE     <Vega3/Vega.iml>
#include <Draw/iml_header.h> 
...


vegamenu.cpp (uses some images in Vega.iml)
...
#define IMAGECLASS    Vega3Img    
#define IMAGEFILE     <Vega3/Vega.iml>
#include <Draw/iml_source.h>  


vegatab1.cpp (uses some images in Vega.iml)
...
//#define IMAGECLASS    Vega3Img // with it I got error   
#define IMAGEFILE <Vega3/Vega.iml>
#include <Draw/iml_source.h>
...


in the previous file if I use "#define IMAGECLASS" the compiler complains
C:\Vega\Vega3\VegaTab1.cpp: In function `void Avail3(One<Ctrl>&)':
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgYes' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:49: error: (Each undeclared identifier is reported only once for each function it appears
	 in.)
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgNo' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgMaybe' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp: In constructor `VegaTab1::VegaTab1()':
C:\Vega\Vega3\VegaTab1.cpp:89: error: `imgYes' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:128: error: `female' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:128: error: `male' undeclared (first use this function)
Vega3: 1 file(s) built in (0:08.07), 8078 msecs / file, duration = 8094 msecs


vegatab4.cpp (uses some images in Vega.iml)
... 
#define IMAGEFILE <Vega3/Vega.iml>
#include <Draw/iml_source.h>
...

But this last one works even if I set
... 
//#define IMAGEFILE <Vega3/Vega.iml>
//#include <Draw/iml_source.h>
...


Luigi
Re: how to #define/#include correctly the .iml file [message #3460 is a reply to message #3448] Thu, 25 May 2006 22:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Only single ".h" and single ".cpp" placement is needed - as long as .cpp include that ".h" (it is in fact same as declaring (in .h) / defining (in .cpp) class and its methods).

Means you can most likely delete .iml include from vegatab1.cpp and vegatab4.cpp.

Mirek
Re: how to #define/#include correctly the .iml file [message #3464 is a reply to message #3460] Thu, 25 May 2006 23:21 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1071
Registered: March 2006
Location: Italy
Experienced Contributor
luzr wrote on Thu, 25 May 2006 22:54

Only single ".h" and single ".cpp" placement is needed - as long as .cpp include that ".h" (it is in fact same as declaring (in .h) / defining (in .cpp) class and its methods).

Means you can most likely delete .iml include from vegatab1.cpp and vegatab4.cpp.

Mirek

In vegatab4.cpp you are right, but in vegatab1.cpp if I remove it I get complain from the compiler:
C:\Vega\Vega3\VegaTab1.cpp: In function `void Avail3(One<Ctrl>&)':
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgYes' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:49: error: (Each undeclared identifier is reported only once for each function it appears
	 in.)
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgNo' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgMaybe' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp: In constructor `VegaTab1::VegaTab1()':
C:\Vega\Vega3\VegaTab1.cpp:89: error: `imgYes' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:128: error: `female' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:128: error: `male' undeclared (first use this function)

Luigi
Re: how to #define/#include correctly the .iml file [message #3466 is a reply to message #3464] Thu, 25 May 2006 23:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
forlano wrote on Thu, 25 May 2006 17:21

luzr wrote on Thu, 25 May 2006 22:54

Only single ".h" and single ".cpp" placement is needed - as long as .cpp include that ".h" (it is in fact same as declaring (in .h) / defining (in .cpp) class and its methods).

Means you can most likely delete .iml include from vegatab1.cpp and vegatab4.cpp.

Mirek

In vegatab4.cpp you are right, but in vegatab1.cpp if I remove it I get complain from the compiler:
C:\Vega\Vega3\VegaTab1.cpp: In function `void Avail3(One<Ctrl>&)':
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgYes' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:49: error: (Each undeclared identifier is reported only once for each function it appears
	 in.)
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgNo' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:49: error: `imgMaybe' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp: In constructor `VegaTab1::VegaTab1()':
C:\Vega\Vega3\VegaTab1.cpp:89: error: `imgYes' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:128: error: `female' undeclared (first use this function)
C:\Vega\Vega3\VegaTab1.cpp:128: error: `male' undeclared (first use this function)

Luigi



Do you include "vegamain.h" there?

Mirek
Re: how to #define/#include correctly the .iml file [message #3467 is a reply to message #3466] Fri, 26 May 2006 00:01 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1071
Registered: March 2006
Location: Italy
Experienced Contributor
luzr wrote on Thu, 25 May 2006 23:44


Do you include "vegamain.h" there?

Mirek


Yew, I do.
Re: how to #define/#include correctly the .iml file [message #3472 is a reply to message #3467] Fri, 26 May 2006 06:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
forlano wrote on Thu, 25 May 2006 18:01

luzr wrote on Thu, 25 May 2006 23:44


Do you include "vegamain.h" there?

Mirek


Yew, I do.


Then something is wrong...

Mirek
Re: how to #define/#include correctly the .iml file [message #3769 is a reply to message #3472] Fri, 23 June 2006 14:13 Go to previous message
forlano is currently offline  forlano
Messages: 1071
Registered: March 2006
Location: Italy
Experienced Contributor
luzr wrote on Fri, 26 May 2006 06:55

forlano wrote on Thu, 25 May 2006 18:01

luzr wrote on Thu, 25 May 2006 23:44


Do you include "vegamain.h" there?

Mirek


Yew, I do.


Then something is wrong...

Mirek


With the 606-dev3 this issue has been totally resolved.
Luigi
Previous Topic: How to show the plot of a function
Next Topic: How to display an icon on the right side of a label/button
Goto Forum:
  


Current Time: Sun Nov 17 01:40:46 CET 2019

Total time taken to generate the page: 0.04872 seconds