Bookstore

Recent

Author Topic: Undefined symbol: WSRegisterCustomImageList but I'm not using LCL  (Read 6551 times)

hinst

  • Sr. Member
  • ****
  • Posts: 303
I get the following error on linking stage:
Code: [Select]
Error: Undefined symbol: WSRegisterCustomImageList
However the problem is that my project is not supposed to require LCL. I am trying to figure out which unit of my project depends on LCL to, but no luck
Advice plz?

gawd this is frustrating; yesterday my project was fine, but not the compiler throws this error unless I include Interfaces module.

This is causing real problems for me
« Last Edit: March 05, 2014, 11:03:51 am by hinst »
Too late to escape fate

howardpc

  • Hero Member
  • *****
  • Posts: 3355
Re: Undefined symbol: WSRegisterCustomImageList but I'm not using LCL
« Reply #1 on: March 03, 2014, 04:00:00 pm »
You do not give enough info to comment. What platform/target CPU? Is your app for console or GUI, if GUI what widgetset? Which units are specified in your .lpr? How many units involved, and what is specified in their uses clauses? What dependencies does the Project Inspector show? Are you linking any resources (-k option) ... etc.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8159
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Undefined symbol: WSRegisterCustomImageList but I'm not using LCL
« Reply #2 on: March 03, 2014, 05:19:14 pm »
The comment at the start of WSFactory unit gives an insight:
Quote
{ These functions are implemented by the LCL backends.
  If you get a linker error for one of these functions you probably forgot
  to add the unit "interfaces" to your program.
  The unit interfaces must be added as one of the first units of the main program.

  Example for a linker error:
    /path/to/lazarus/lcl/units/x86_64-linux/wsimglist.o: In function `REGISTERCUSTOMIMAGELIST':
    /path/to/lazarus/lcl//widgetset/wsimglist.pp:266: undefined reference to `WSRegisterCustomImageList'
}

Quote
I am trying to figure out which unit of my project depends on LCL to, but no luck
Project->Show used .ppu files

hinst

  • Sr. Member
  • ****
  • Posts: 303
Re: Undefined symbol: WSRegisterCustomImageList but I'm not using LCL
« Reply #3 on: March 03, 2014, 10:06:03 pm »
Oops, problem solved (most likely)
I recompiled this project on another PC, this time it did not fail on linking stage
Perhaps something is wrong with the Lazarus installation I have (the first one, on which I initially tried to compile my proj.). I will just remove it, clean settings and install again. I remember now that I was messing with Lazarus packages recently, so perhaps I just occasionally included some unit (which does not belong there) in one of the standard packages
Too late to escape fate

hinst

  • Sr. Member
  • ****
  • Posts: 303
Re: Undefined symbol: WSRegisterCustomImageList but I'm not using LCL
« Reply #4 on: March 05, 2014, 11:32:36 am »
Turned out:
In unit EpikTimer I had:
Code: [Select]
uses
  ...
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, dateutils;
Where Forms, Controls, Graphics, Dialogs were included for no reason
I removed these dependencies in EpikTimer on my first PC, but on another PC I had a copy of EpikTimer too, where I did not remove these dependencies
I managed to track it down using "Show PPU files" tool
Too late to escape fate

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Undefined symbol: WSRegisterCustomImageList but I'm not using LCL
« Reply #5 on: March 06, 2014, 12:22:01 pm »
Mmm, if EpikTimer works well without those, perhaps the source can be updated:
http://wiki.lazarus.freepascal.org/EpikTimer
indicates it's on Lazarus-CCR, so raising a bug on the bugtracker in the Lazarus-CCR category should get the attention of the responsible developer...

Thanks,
BigChimp
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified