Recent

Author Topic: FPC not recognize symbols in units in include path  (Read 2701 times)

nadavvin

  • New Member
  • *
  • Posts: 28
FPC not recognize symbols in units in include path
« on: November 19, 2018, 08:06:03 pm »
Hello

I am porting HeidiSQl to Lazarus and my project is here: https://github.com/nadavvin/HeidiLazarusSQL
The project file itself is in packages/Lazarus

When I do build, it failed compile on TObjectList on Main which defined in components/generics.collections/src/generics.collections.pas which also exists in include path.

The problems is when compile it is generate a new file with the same name at: components/generics.collections/generics.collections.pas

Compiler options path:
https://i.imgur.com/zkqUpZOl.png

Project inspector:
https://imgur.com/wc1qkiJl.png


Thanks for your help.
My previous post was on November 03, 2018
http://forum.lazarus-ide.org/index.php/topic,43094.0.html
« Last Edit: November 22, 2018, 08:29:45 pm by nadavvin »

nadavvin

  • New Member
  • *
  • Posts: 28
Re: FPC not recognize symbols in units in include path
« Reply #1 on: November 22, 2018, 08:09:23 pm »
Found the problem that is not because symbol not found because in Lazarus I have to put "<TComponent>" while in real Delphi it is not needed

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: FPC not recognize symbols in units in include path
« Reply #2 on: November 22, 2018, 08:35:36 pm »
Found the problem that is not because symbol not found because in Lazarus I have to put "<TComponent>" while in real Delphi it is not needed
Where do you have to put "<TComponent>"?
Looking at your "Compiler options path" and "Project inspector" screenshots, you added generics.collections to your project and unit search path.
Isn't generics.collections a package? You should only add a dependency for it.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

nadavvin

  • New Member
  • *
  • Posts: 28
Re: FPC not recognize symbols in units in include path
« Reply #3 on: November 23, 2018, 03:52:06 pm »
https://github.com/nadavvin/HeidiLazarusSQL/commit/f310f5d09b05c8c6ae46e65f16acc99a488b71dc

Editors: TObjectList<TComponent>;
Editors := TObjectList<TComponent>.Create;


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: FPC not recognize symbols in units in include path
« Reply #4 on: November 23, 2018, 04:06:46 pm »
In Delphi that afaik depends on version. Originally it was in classes, later it moved to contnrs (D6+) afaik.  In comparisons with Delphi always list the exact code and the used version (and double check that it is still the case, a mistake is easily made)

in FPC/Lazarus the plain tobjectlist is also in contnrs. If you importat contnrs before generics.collections in the uses list you can refer to the non generic one as

Code: Pascal  [Select][+][-]
  1.   x:=contnrs.tobjectlist<contnrs>.create

 

TinyPortal © 2005-2018