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 » Linking error with imagefile
Linking error with imagefile [message #58768] Tue, 23 August 2022 18:07 Go to next message
GiuMar is currently offline  GiuMar
Messages: 4
Registered: August 2022
Location: Italy
Junior Member
Hi all,

I'm a very beginner with UPP. I started to write a simple app, while adding some icons to a toolbar I get the following error message by the linker:

 (): Linking has failed
 (): ld.lld: error: undefined symbol: ImmaginiImg::Get(int)
C:\upp\MyApps\BasicCtrlLibApp\Immagini.iml (2): >>> referenced by C:\upp\MyApps\BasicCtrlLibApp\Immagini.iml:2
 (): >>>               C:/upp/out/MyApps/BasicCtrlLibApp/CLANGx64.Debug.Debug_Full.Gui.Main\main.o:(ImmaginiImg::layers())
 (): clang-14: error: linker command failed with exit code 1 (use -v to see invocation)



I used just a simple Iml file with one icon and used the following code in my main.cpp file:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define IMAGECLASS ImmaginiImg
#define IMAGEFILE <BasicCtrlLibApp/Immagini.iml>
#include <Draw/iml_header.h>


If I try to use any standard icon coming from CtrlImg, It compiles without errors.

Does anybody can help?
Re: Linking error with imagefile [message #58773 is a reply to message #58768] Fri, 26 August 2022 12:24 Go to previous messageGo to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 220
Registered: June 2011
Experienced Member
IIRC

#include <Draw/iml_source.h>


goes in one and only one source file and

#include <Draw/iml_header.h>


goes in every header file. If all your code is in a single .cpp file you might want to do

#include <Draw/iml.h>


which will include both. I think your linker error is coming from the fact that you don't have the iml_source.h included which implements Get.
Re: Linking error with imagefile [message #58781 is a reply to message #58773] Tue, 30 August 2022 19:13 Go to previous message
GiuMar is currently offline  GiuMar
Messages: 4
Registered: August 2022
Location: Italy
Junior Member
Thank you very much! Smile Smile

I did
#include <Draw/iml.h>

instead of
#include <Draw/iml_header.h>

and It works perfectly.
Previous Topic: Read a PDF
Next Topic: App "swallowing" mouseclicks
Goto Forum:
  


Current Time: Fri Apr 19 12:36:49 CEST 2024

Total time taken to generate the page: 0.01997 seconds