Lazarus

Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: Prime on January 11, 2008, 03:39:40 pm

Title: Problem installing Indy 10.2.0.3
Post by: Prime on January 11, 2008, 03:39:40 pm
Hi,

I'm trying to install Indy 10.2.0.3 on the Lazarus 0.9.24 beta and am running into the following problem, I open indylaz.lpk and hit compile, the compile stops with the error :-

E:\LazLibs\indy-10.2.0.3\lazarus\IdDsnCoreResourceStrings.pas(76,12) Fatal: Can't find unit IdGlobal used by IdAboutVCL

The cursor is positioned between the following lines in IdDsnResourceStrings :-

  RSAAboutKitchenSink = IndyPitCrew+#10#13+'present the'#10#13'Kitchen Sink';

  {Binding Editor stuff}
 
Which seems strange.

Instalation is as follows :-

Lazarus 0.9.24 beta from lazarus download page, Indy 10.2.0.3  from Lazarus port page on Indy site.

Lazarus is installed in c:\Lazarus, indy in e:\LazLib\indy-10.2.3  OS is Windows 2003 SP2, I will also try on Windows XP SP2.

Anyone know what the problem is ?

Cheers.

Phill.
Title: Re: Problem installing Indy 10.2.0.3
Post by: Phil on January 13, 2008, 01:29:54 am
Quote from: "Prime"
Anyone know what the problem is ?


Hi Phil,

Offhand it looks like Lazarus can't find the IdGlobal.pas unit, which is in Indy's fpc folder, not its lazarus folder where indylaz.lpk is. Also, the error message does seem to indicate that the compiler is confused about where it is.

Have you tried installing it in one of the more recent Lazarus 0.9.25 snapshots to see if it's something that's been fixed since your 0.9.24.

You could also try compiling indylaz.lpk with the lazbuild program from the command line. That won't install it in the IDE but at least you would then have compiled units. I use Indy but I don't install it in the IDE.

Thanks.

-Phil
Title: Problem installing Indy 10.2.0.3
Post by: leiteiro on August 20, 2008, 04:57:43 pm
In package of indy window,
click on button "Compiler Options",
and in Paths tab in Other Unit File (-Fu)
insert "..\ftp\"
Then compile
Title: Re: Problem installing Indy 10.2.0.3
Post by: Teo on November 10, 2009, 10:35:04 pm
Confirm: this works on both Suze11 and Ubuntu.
Title: Re: Problem installing Indy 10.2.0.3
Post by: picstart on November 11, 2009, 09:49:01 am
It is possible to work around this issue but you have to be aware of what you wish for. Indy will swamp the lazarus IDE with components. It has enough icons to make iconoclasts out of icon lovers. After installing I removed it as it was to bloated to be useful. I'm hoping lnet will be fixed so its lpk can install in 28.2.
Title: Re: Problem installing Indy 10.2.0.3
Post by: andrew_answer on February 18, 2013, 06:32:45 pm
1. Download Indy from http://www.indyproject.org/Sockets/fpc/indy-10.2.0.3.zip

2. Open lazarus\indylaz.lpk via Open package... (*.lpk)

3. Go to Params\Paths (-Fu) and put line

..\fpc

into textinput.

4. Click OK, then Use - Install.
Title: Re: Problem installing Indy 10.2.0.3
Post by: Dorbah on June 26, 2014, 10:04:38 pm
1. Download Indy from http://www.indyproject.org/Sockets/fpc/indy-10.2.0.3.zip
2. Open lazarus\indylaz.lpk via Open package... (*.lpk)
3. Go to Params\Paths (-Fu) and put line
..\fpc;..\lazarus
and in Other source files (.pp/.pas files) and put line
..\fpc;..\lazarus
into textinput.
4. Click OK, then Use - Install.
Title: Re: Problem installing Indy 10.2.0.3
Post by: christensen on January 18, 2016, 11:04:56 pm
Today i faced this issue with indy-10.2.0.3 and i've solved like this:

Quote
1. Download Indy from http://www.indyproject.org/Sockets/fpc/indy-10.2.0.3.zip
2. Open lazarus\indylaz.lpk via Open package... (*.lpk)
3. Go to Params\Paths (-Fu) and put line
..\fpc;..\lazarus

Thanks
Title: Re: Problem installing Indy 10.2.0.3
Post by: Graeme on January 19, 2016, 12:25:29 am
Again, what is the obsession with "installing components into the IDE" - why not simply instantiate the class you need in code and use it as normal. No IDE install issues to worry about at all. With  Lazarus IDE, MSEide, Maximus all supporting path macros, setting up flexible source paths has never been so easy, so you don't even need Lazarus Packages any more.

On a side note: I'm using the latest Indy 10 directly from their code repository with FPC 3.0 under FreeBSD - granted I didn't install it into Lazarus IDE (as I never do with any components I use), so I don't know if there are install issues or not. But I can say that Indy (from SVN) works perfectly out of the box.

  Indy SVN:  https://svn.atozed.com:444/svn/Indy10/trunk (https://svn.atozed.com:444/svn/Indy10/trunk)

ps:
  Indy 10.2.0.3 is rather old. I believe the latest version is now at v10.6.2.
Title: Re: Problem installing Indy 10.2.0.3
Post by: HatForCat on February 03, 2016, 04:58:49 pm
Again, what is the obsession with "installing components into the IDE" - why not simply instantiate the class you need in code and use it as normal.

I guess some chest thumping is OK, but assuming everyone knows how to do that, is not. ;)

Sooo, how about a step-by-step in how to use packages without installing them if it such a lamentable thought to install them instead?
Title: Re: Problem installing Indy 10.2.0.3
Post by: Graeme on February 04, 2016, 01:50:55 am
I guess some chest thumping is OK, but assuming everyone knows how to do that, is not. ;)
It's got nothing to do with chest thumping. ;-)  Think about what happens when you drop a component on a a form. The Form Designer addes a field variable of a specific type. It probably adds a new unit in the uses clause. It adds the "creation" code inside the *.lfm file.

Defining and instantiating a class manually does exactly the same as what the form designer does. The "creation" code is simply not in the *.lfm file, but rather somewhere in the .pas file.

Quote
Sooo, how about a step-by-step in how to use packages without installing them if it such a lamentable thought to install them instead?
This was discussed so many times before. Take a look at the following link. It shows a fully working code example, instantiating a FTP Client instance and retrieves a directory listing from the FTP server.

http://forum.lazarus.freepascal.org/index.php/topic,31142.msg199478.html#msg199478 (http://forum.lazarus.freepascal.org/index.php/topic,31142.msg199478.html#msg199478)
Title: Re: Problem installing Indy 10.2.0.3
Post by: snorkel on February 10, 2016, 07:09:09 am
Again, what is the obsession with "installing components into the IDE" - why not simply instantiate the class you need in code and use it as normal. No IDE install issues to worry about at all. With  Lazarus IDE, MSEide, Maximus all supporting path macros, setting up flexible source paths has never been so easy, so you don't even need Lazarus Packages any more.

On a side note: I'm using the latest Indy 10 directly from their code repository with FPC 3.0 under FreeBSD - granted I didn't install it into Lazarus IDE (as I never do with any components I use), so I don't know if there are install issues or not. But I can say that Indy (from SVN) works perfectly out of the box.

  Indy SVN:  https://svn.atozed.com:444/svn/Indy10/trunk (https://svn.atozed.com:444/svn/Indy10/trunk)

ps:
  Indy 10.2.0.3 is rather old. I believe the latest version is now at v10.6.2.

I just installed 10.6.2 into Lazarus 1.6 rc2 using the package and it worked fine, only issue was the paths need to be tweaked in the package and for some reason you need to have all the paths in your project as well.  It's just nice having them installed in the IDE.  I know you can just create what you need, but having them in the pallet does simplify creating the event handlers etc..
Not a huge deal if you have to do it all manually though.
Title: Re: Problem installing Indy 10.2.0.3
Post by: balazsszekely on February 10, 2016, 07:24:47 am
Quote
@snorkel
I just installed 10.6.2 into Lazarus 1.6 rc2 using the package and it worked fine
There are still some unresolved issues with indy 10.6.2, regardless if you install in the IDE or not. For example add IdSync to the uses clauses and try to compile/build a project, it will fail. Why you need IdSync? To update the GUI from inside a thread. It's a very important unit for Client/Server applications. The only fix I find so far is to copy all units in a single directory. This way everything works as it should.
Title: Re: Problem installing Indy 10.2.0.3
Post by: Graeme on February 10, 2016, 11:16:41 am
There are still some unresolved issues with indy 10.6.2, regardless if you install in the IDE or not. For example add IdSync to the uses clauses and try to compile/build a project, it will fail.

Please see the comments in the Mantis report: bugs.freepascal.org/view.php?id=29564 (http://bugs.freepascal.org/view.php?id=29564)

The problem is not with FPC and not with Indy. The issue is Lazarus IDE and Lazarus Packages. The indylaz.lpk is simply a reliable and reproducable example of the Lazarus IDE problem.

Plus I just tried your example of including IdSync in a project, with many other Indy units. The project doesn't use indylaz.lpk, but rather specifies the unit and include paths manually in the project (in fact I used MSEide to manage my project). I cleaned out all previous compiled units, and I managed to compile my project in one pass - no compilation errors at all. See attached file that shows my compiler output. The IdSync is compiled at line 607.

So again, the problem is not with Indy, but with Lazarus IDE.
Title: Re: Problem installing Indy 10.2.0.3
Post by: balazsszekely on February 10, 2016, 12:15:28 pm
Quote
Please see the comments in the Mantis report: bugs.freepascal.org/view.php?id=29564
Did you see Sven's comment?

Quote
So again, the problem is not with Indy, but with Lazarus IDE.
I compiled and installed many lazarus package before and I never encountered this strange behaviour. By the way, if I add IdSync to indylaz.lpk everything works fine, so I find it hard to believe, this is a Lazarus IDE and Lazarus Packages issue. Even if it is a lazarus package issue, still need to be fixed, most of us works with lazarus not MSEide.

Title: Re: Problem installing Indy 10.2.0.3
Post by: Graeme on February 10, 2016, 12:41:42 pm
Did you see Sven's comment?
Yes, and please see my reply too.

Quote
I compiled and installed many lazarus package before and I never encountered this strange behaviour. By the way, if I add IdSync to indylaz.lpk everything works fine, so I find it hard to believe, this is a Lazarus IDE and Lazarus Packages issue.
I don't find it so hard to believe at all.  :) Your example of adding IdSync to indylaz.lpk just proves that. The IdSync unit is located in the unit paths specified in the indylaz.lpk package, so why doesn't Lazarus find it in the first place. If you ever review the actual compiler parameters that Lazarus IDE produces (run lazarus from a console window to see this easily), it makes many mistakes. It often injects compiler parameters I did not specify, adds conflicting parameters etc. This all has a knock-on effect and is one explanation why sometimes projects don't compile via Lazarus IDE, but does from the command line or from MSEide, Maximus IDE etc.

Quote
Even if it is a lazarus package issue, still need to be fixed, most of us works with lazarus not MSEide.
Yes indeed, but it doesn't help that the Mantis report is filed under the wrong project. Currently it is filed under the "mantis" project (where you report Mantis Bug Tracker bugs), when it should be filed under the "lazarus" project. So currently no Lazarus developer is going to see that report, or any notifications for it.
Title: Re: Problem installing Indy 10.2.0.3
Post by: balazsszekely on February 10, 2016, 02:30:36 pm
@Graeme

I want to keep an open mind about this, so please attach the proof you mentioned on the bugtracker. If it is a Lazarus issue, I will do my best to fix it.
Title: Re: Problem installing Indy 10.2.0.3
Post by: Graeme on February 10, 2016, 04:07:58 pm
@GetMem:  Take a look at the Mantis bug report. I've attached a project there. One of my comments explain what you need to modify to get it to work on your system.

http://bugs.freepascal.org/view.php?id=29564 (http://bugs.freepascal.org/view.php?id=29564)
Title: Re: Problem installing Indy 10.2.0.3
Post by: ChrisF on February 10, 2016, 04:10:25 pm
@Graeme:

Just for demonstration purposes, add the IdStreamVCL unit at the top of the "uses" clause (to be sure it's compiled before the IdGlobal unit) in your test program.

Something like:
Code: Pascal  [Select][+][-]
  1. ...
  2. uses
  3.   {$ifdef unix}cthreads,{$endif}
  4.   Sysutils, Classes
  5.  
  6.   ,IdStreamVCL
  7.   // ftp client component
  8.   ,IdFTP
  9. ...
  10.  

This time, you'll see that this unit is compiled twice:
Quote
...
Free Pascal Compiler version 3.0.0 [2016/01/10] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
Compiling C:\WORK\INTER\indy\Lib\System\IdStreamVCL.pas
Compiling C:\WORK\INTER\indy\Lib\System\IdGlobal.pas
Compiling C:\WORK\INTER\indy\Lib\System\IdException.pas
Compiling C:\WORK\INTER\indy\Lib\System\IdResourceStrings.pas
Writing Resource String Table file: IdResourceStrings.rsj
Compiling C:\WORK\INTER\indy\Lib\System\IdStream.pas
Compiling C:\WORK\INTER\indy\Lib\System\IdStreamVCL.pas
...

This is the origin of the problem for the Indy package installation within Lazarus.

I guess a workaround could be to force to compile IdGlobal before IdStreamVCL (by putting it in the first place of the package compilation).

AFAIR, it's OK in this later case.

Which is also the case for your "unmodified" test program, as IdGlobal is then compiled before IdStreamVCL (during the IdFTP unit compilation).
Title: Re: Problem installing Indy 10.2.0.3
Post by: Graeme on February 10, 2016, 04:38:24 pm
Just for demonstration purposes, add the IdStreamVCL unit at the top of the "uses" clause (to be sure it's compiled before the IdGlobal unit) in your test program.

And as you can see from the IdStream unit, you are not supposed to use IdStreamVCL directly, instead you should use IdStream and TIdStreamHelper if needed.

Indy is far from unique in this regards - circular dependencies or required order of a uses clause. I have seem many cases where different libraries have common class names etc and the uses clause order is important. In the case of Indy, they supplied the IdStream unit for you, which also defines the uses clause in the correct order.

Even the indylaz.lpk defines the order correctly... IdGlobal, IdStream and then IdStreamVCL. The latter unit shouldn't even be needed in the indylaz.lpk package.

Quote
I guess a workaround could be to force to compile IdGlobal before IdStreamVCL (by putting it in the first place of the package compilation).
As I mentioned, that is what the indylaz.lpk package already does.

Another test to show how Lazarus breaks a working project. As you now know my [mantis] attached example project compiles first time without error from the command line.
Magically, Lazarus fails to compile the project with a mention of a missing unit, and an unexpected CRC changes in a PPU file. Why???  The build script worked just fine, so what does Lazarus IDE do to break the project?  Again, a Lazarus IDE issue. Not FPC, not Indy.
Title: Re: Problem installing Indy 10.2.0.3
Post by: ChrisF on February 10, 2016, 06:40:50 pm
The issue is not really concerning circular dependencies, but inlined procedures/functions into units with circular dependencies.

As a proof of concept, disabling the possibility to get inlined procedures/functions into Indy by adding the "-dDEBUG" option to the package compilation allows to install the Indy package without a second compilation.

Inlining within Indy is indeed undefined in all the IdCompilerDefines.inc files with:
Code: Pascal  [Select][+][-]
  1. ...
  2. {$IFDEF DEBUG}
  3.   {$UNDEF USE_INLINE}
  4. {$ENDIF}
  5. ...
  6.  
Title: Re: Problem installing Indy 10.2.0.3
Post by: ChrisF on February 10, 2016, 06:42:34 pm
...
And as you can see from the IdStream unit, you are not supposed to use IdStreamVCL directly, instead you should use IdStream and TIdStreamHelper if needed.
...

You're quite right. This was just a simple way to provoke the concerned "issue".
TinyPortal © 2005-2018