Difference between revisions of "Indy with Lazarus"

From Lazarus wiki
Jump to navigationJump to search
m (Steps to install indy 10.2.0.3 into windows Lazarus)
Line 62: Line 62:
 
* Indy10 servers didn't work before due to an exception occuring during startup, which shut everything down. You need FPC 2.2(.0) or later to fix this (pthread_kill problem). This probably also affects Mac OS X.
 
* Indy10 servers didn't work before due to an exception occuring during startup, which shut everything down. You need FPC 2.2(.0) or later to fix this (pthread_kill problem). This probably also affects Mac OS X.
 
* During demo conversion, the bindings property is often wrongly converted. This can result in strange errors, specially because Indy seems to bind to the same port using both IPV4 and IPV6 from time to time. Not fully debugged yet.
 
* During demo conversion, the bindings property is often wrongly converted. This can result in strange errors, specially because Indy seems to bind to the same port using both IPV4 and IPV6 from time to time. Not fully debugged yet.
 +
 +
 +
Unbuntu 10.04 + Lazarus 0.9.28 + Indy 10(Server Component) -> do nothing (running & just crash)
 +
Solution (by bruce0829@yahoo.com.tw):
 +
(1).Lazarus Main menu -> Project -> Compiler Options -> Other Page , add the "-dUseCThreads" parameter
 +
(2).force the IdTCPServer to work in Id_IPV4 mode
 +
  procedure TForm1.FormActivate(Sender: TObject);
 +
  begin
 +
    //uses idGlobal , the Id_IPv4 force the IdTCPServer to work in Id_IPV4 mode.
 +
    IdTCPServer1.Bindings.Add.IPVersion := Id_IPv4; //else, with socket error # 98 , address already in use
 +
    IdTCPServer1.Bindings.Add.IP:='127.0.0.1';
 +
    IdTCPServer1.Bindings.Add.Port:= 6501; //customization
 +
    IdTCPServer1.Active:=true; 
 +
  end;
 +
(3)
  
 
=== How to install ===
 
=== How to install ===

Revision as of 03:39, 27 June 2010

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) 한국어 (ko)

Indy for Lazarus

A new attempt at converting Indy is being undertaken by the Indy core team. FPC developer Marco van de Voort is working with Indy core to get Indy fully working with FPC/Lazarus. Specially Indy's JP Mugaas did a lot of good work in getting Indy10 to work with FPC. The native unixrtl backend is mostly his work too.

Currently Indy10 is nearly fully working, and end-user usability has been improved a lot. Only special topics like OpenSSL and compression might need additional knowledge. 64-bit support hasn't entirely been validated either.

Hint: I'm not very interested in support the Kylix side of Indy. (anything that uses unit libc). I ported it only as step up to native Unix RTL using Indy apps.

Requirements

Currently, FPC 2.0.4 is very close to being able to use indy in all its facets, except for the server bug on FreeBSD/Mac OS X (which requires 2.1.1)

Since Indy10 now works for all major targets, we focus on this version. While conversion to Indy9 might be simpler for people, keep in mind that it only works on win32. (and theoretically could be ported to Linux/x86).

Therefore we recommend people to work with 10 as much as possible.

(For indy9, you might need to remove the overriding of tmemorystream.setsize method (Marcov: ???) to get telnet components working, but Indy9 hasn't been tested in a while)

The port is fairly stable, and JP Mugaas has done a great deal to improve the quality of the release, a set of makefiles inclusive

Downloads / Links

Current snapshots (for die hards only) are at

What works, what not

Indy9:

  • Windows should largely work. Lots of demoes ported.
  • Linux not or barely. No hope at non Linux/x86 (non-Kylix) targets.

Indy10: (Indy10ForFPC branch)

  • Windows and Unix: clients work and servers should work fine in principle.
  • The main work for native Unix RTL done. Servers Clients seem to work with FreeBSD and OS X

All: secure versions not tested yet.

Short term plans

  • Convert demoes to demonstrate/test workings.
  • Fix bugs and enter them back into FPC or Indy RCS.

Problems

  • Indy9 and Indy10 are mutually exclusive, which causes problems for deployment, even the default is a problem:
    • Indy9 is more used and proven in the industry.
    • Indy10 is more portable, and better long term. However uptake seems to be low, and there is not much movement at Indy anymore.
  • How to deploy? Parts belong to Lazarus, parts to FPC.
  • Lot of pkgs and demoes have paths in them. How to centrally fix them so that unexperienced users can build them?
  • Lazarus problems
    • Transparancy problems of icons
    • component tabs don't scroll, if you put a lot of components in one tab, they are not selectable. workaround implemented: JP Mugaas separated them into Indy clients A-M and N-Z etc. Also, meanwhile Lazarus changed to two rows of components per tab.
  • Indy demoes (specially Indy10's) are not very suitable for multiplatform usage. Their setup is awfully windows specific, with spaces in paths, deep nested dirs, and useless baggage (C# code). A short working set of demoes will have to be created.

Bugs

  • Indy10 servers didn't work before due to an exception occuring during startup, which shut everything down. You need FPC 2.2(.0) or later to fix this (pthread_kill problem). This probably also affects Mac OS X.
  • During demo conversion, the bindings property is often wrongly converted. This can result in strange errors, specially because Indy seems to bind to the same port using both IPV4 and IPV6 from time to time. Not fully debugged yet.


Unbuntu 10.04 + Lazarus 0.9.28 + Indy 10(Server Component) -> do nothing (running & just crash) Solution (by bruce0829@yahoo.com.tw): (1).Lazarus Main menu -> Project -> Compiler Options -> Other Page , add the "-dUseCThreads" parameter (2).force the IdTCPServer to work in Id_IPV4 mode

  procedure TForm1.FormActivate(Sender: TObject);
  begin 
    //uses idGlobal , the Id_IPv4 force the IdTCPServer to work in Id_IPV4 mode.
    IdTCPServer1.Bindings.Add.IPVersion := Id_IPv4; //else, with socket error # 98 , address already in use
    IdTCPServer1.Bindings.Add.IP:='127.0.0.1';
    IdTCPServer1.Bindings.Add.Port:= 6501; //customization 
    IdTCPServer1.Active:=true;  
  end;

(3)

How to install

Matthijs: So it is not perfect yet, but you want to try it. Here is how you install it in Lazarus.

  • Open and compile indysystemlaz.lpk
  • Open and compile indycorelaz.lpk
  • Open and compile indyprotocolslaz.lpk
  • Open, compile and install dclindycorelaz.lpk
  • Open, compile and install dclindyprotocolslaz.lpk

Then rebuild Lazarus and you will see a 15 tab's with Indy components.

How to install on debian/ubuntu

  • # cd indy-10.2.0.1/fpc
  • # chmod +x debian/rules
  • # touch README
  • # sudo apt-get install fakeroot
  • # dpkg-buildpackage -rfakeroot -uc
  • # cd ..
  • # sudo dpkg -i *.deb
  • install package indylaz.lpk in lazarus

How to install [2]

If you couldn't install Indy for Lazarus with tips above, you can try this...

From Yahoo! Brazil, Lazarus Group (User Everaldo)

Version installed on Lazarus 0.9.24 using component indy-10.2.0.1.

  • Unzip the component from file tar.gz (must be this file, the "zip file" does not work) in directory $(LazarusDir)\components;
  • Go to directory $(LazarusDir)\components\indy-10.2.0.1\ and to create inside them a directory named "saved";
  • Copy the content of the directory $(LazarusDir)\components\indy-10.2.0.1\lazarus\ to directory "saved" created above;
  • Copy the content of directory $(LazarusDir)\components\indy-10.2.0.1\fpc\ to directory $(LazarusDir)\components\indy-10.2.0.1\lazarus, and rewrite all files, ok;
  • Get the content of directory "saved" and copy inside of $(LazarusDir)\components\indy-10.2.0.1\lazarus and you can delete "saved" directory now;
  • Install the package laz.lpk (available in $(LazarusDir)\components\indy-10.2.0.1\lazarus\indy) of conventional way.

On LINUX the path is: /usr/lib/lazarus/components/indy-10.2.0.1/, right!!!

I hope this was helpful for you, good luck!!!

How to install [3] Windows, Indy 10.2.0.3

1. make clean 2. make all 3. make install This will put the indy files into the FPC units directories

  • From within Lazarus do a Package -> Open package file -> from the indy /lazarus dir, open the indylaz.lpk
  • In the "Compiler options" put

c:\pp\units\i386-win32\indy\ (or wherever the FPC indy units are installed after "make install") into the "Other unit files" field

  • compile then install (will rebuild Lazarus)