Recent

Author Topic: Circular reference between windows.pas and types.pp  (Read 11083 times)

RodneyK

  • New Member
  • *
  • Posts: 16
Circular reference between windows.pas and types.pp
« on: December 22, 2010, 06:20:25 pm »
I'm a newbie to LazarusI  but have been using Delphi for 15 years.
I need to convert a Delphi app into a lazarus app so I can compile a 64 bit version.
The Delphi App has one form which is still a .dfm so LCL is not a defined compiler directive. But I have converted the units to Lazarus using the XDevToolkit

In the unit uses clauses the following has been inserted:

  {$IFNDEF LCL}
    Windows, Messages,
  {$ELSE}
    LclIntf, LMessages, LclType,
  {$ENDIF}
 
The compiler tries to use windows.pas but produces a "Error Circular unit reference between types and Windows."

Windows has 'Types' in its unit clause and at first I couldn't understand why there would be a problem, until I found out that the compiler was trying to use types.pp which is part of the Lazarus LCL.

My question is how do I make the compiler use the Windows' Types.pas and not the Lazarus LCL Version.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Circular reference between windows.pas and types.pp
« Reply #1 on: December 22, 2010, 06:27:47 pm »
Can you make empty application with no changes and add Windows at start of its uses-clause, then compile and report what happens?

I'm just guessing some version differences with the Lazarus or fpc you're using.

captian jaster

  • Guest
Re: Circular reference between windows.pas and types.pp
« Reply #2 on: December 22, 2010, 06:36:44 pm »
Can you make empty application with no changes and add Windows at start of its uses-clause, then compile and report what happens?

I'm just guessing some version differences with the Lazarus or fpc you're using.
This could be it...
Putting windows in the uses clause doesn't bring any error for me.
I put LCL in the required packages too..
Then I tried it without LCL..
Worked fine.. What other packages are you using?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2687
Re: Circular reference between windows.pas and types.pp
« Reply #3 on: December 22, 2010, 07:07:14 pm »
The LCL has no types.pp so I don't know where you got that one from.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

captian jaster

  • Guest
Re: Circular reference between windows.pas and types.pp
« Reply #4 on: December 22, 2010, 07:25:47 pm »
The LCL has no types.pp so I don't know where you got that one from.
So then all he should do is re-install(Or install) the latest version of lazarus..

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Circular reference between windows.pas and types.pp
« Reply #5 on: December 22, 2010, 10:03:18 pm »
I'll try building a dummy app to see what happens. But types.pp is in c:\lazarus\fpc\2.2.4\source\rtl\objpas\ and types.ppu is in c:\lazarus\fpc\2.2.4\units\x86_64-win64\rtl

I've also tried putting -dLCL in the compiler options but the error still occurs, but this time actually in the uses clause containing Types

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12797
  • FPC developer.
Re: Circular reference between windows.pas and types.pp
« Reply #6 on: December 22, 2010, 10:41:58 pm »
I'll try building a dummy app to see what happens. But types.pp is in c:\lazarus\fpc\2.2.4\source\rtl\objpas\ and types.ppu is in c:\lazarus\fpc\2.2.4\units\x86_64-win64\rtl

I've also tried putting -dLCL in the compiler options but the error still occurs, but this time actually in the uses clause containing Types

Afaik the FPC sources should only be in the browsing path, and the unit path should contain the paths with precompiled (.ppu) files.

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Circular reference between windows.pas and types.pp
« Reply #7 on: December 22, 2010, 10:57:21 pm »
I tried building a test app and in doing so discovered my error. In my ignorance I was pointing the compiler to the Delphi directory containing windows.pas instead of the Lazarus directory holding windows.pp. My bad and I apologise for wasting time.

However now I am pointing the compiler to the correct directories the compiler baulks at {$I fileutil.inc} in FileUtil.pp.
As far as I can see the file opens up in Notepad with no problem and even if I replace the old one with an identical new version it still says it can't open it.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Circular reference between windows.pas and types.pp
« Reply #8 on: December 23, 2010, 01:35:11 am »
I can recommend trying the Daily snapshot for Lazarus. fpc 2.2.4 and the default version is now propably many years old. Lazarus is updating daily and is really way ahead in everything. The snapshots have a nice installer which should do most of the config for you properly. To be sure you can uninstall and clear previous Lazarus folder.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Circular reference between windows.pas and types.pp
« Reply #9 on: December 23, 2010, 09:08:08 am »
Rodney, don't point the compiler to rtl and lcl sources, but to the compiled units. If you point to the sources, you end up with compiled RTL units in all places, and you will get into to trouble, even if you manage to get the include paths right.

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Circular reference between windows.pas and types.pp
« Reply #10 on: December 27, 2010, 08:18:55 pm »
Thanks Vincent. I'll make sure to do that.

 

TinyPortal © 2005-2018