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 » To split Images code to "h" & "cpp" file has a link error, "multiple de
To split Images code to "h" & "cpp" file has a link error, "multiple de [message #19652] Mon, 29 December 2008 10:44 Go to next message
sevenjay is currently offline  sevenjay
Messages: 30
Registered: October 2008
Location: Taiwan
Member
I split "Image tutorial 1" code to "h" & "cpp" file and had some link error: "multiple definition".
C:/upp/out/Image01/MINGW.Debug.Debug_full.Gui.Main\main.o: In function `_ZN8MyImages3ImlEv':
C:/upp/uppsrc/Draw/iml_source.h:33: multiple definition of `MyImages::Iml()'
C:/upp/out/Image01/MINGW.Debug.Debug_full.Gui.Main\image.o:C:/upp/uppsrc/Draw/iml_source.h:33: first defined here
...
...

After executing TheIDE, compiling It was success at first time. I modify something then compile it was fail.
It both happened on Ubuntu and Windows using gcc.
The Attachment is a sample code.

But I move the definition
#define IMAGECLASS MyImages
#define IMAGEFILE  <Image01/images.iml>
#include <Draw/iml.h>

from .h to .cpp. then it is success all the time.
so...maybe this is not a bug?

Thank you for creating so useful tool.
  • Attachment: Image01.zip
    (Size: 1.66KB, Downloaded 316 times)

[Updated on: Mon, 29 December 2008 10:45]

Report message to a moderator

Re: To split Images code to "h" & "cpp" file has a link error, "multipl [message #19654 is a reply to message #19652] Mon, 29 December 2008 19:36 Go to previous messageGo to next message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
You have to put in header
#include <Draw/iml_header.h>

and
#include <Draw/iml_source.h>

in *.cpp file instead of
#include <Draw/iml.h>

which is used when you have to use images in one file.


cdabbd745f1234c2751ee1f932d1dd75
Re: To split Images code to "h" & "cpp" file has a link error, "multipl [message #19676 is a reply to message #19654] Sun, 04 January 2009 15:04 Go to previous message
mirek is currently offline  mirek
Messages: 13849
Registered: November 2005
Ultimate Member
BTW, theide recently can insert those includes for you (right-click on the text, "Insert").

Mirek
Previous Topic: Compile package with iml file problem!
Next Topic: Conditional jump or move depends on uninitialised value(s)
Goto Forum:
  


Current Time: Sat Mar 25 08:23:41 CET 2023

Total time taken to generate the page: 0.01058 seconds