Recent

Author Topic: [SOLVED] How to compile \fpc\3.0.4\source\packages\fcl-net\examples\testhst.pp ?  (Read 2373 times)

Hartmut

  • Hero Member
  • *****
  • Posts: 742
I just wanted to compile <installdir>\fpc\3.0.4\source\packages\fcl-net\examples\testhst.pp on Windows and failed. Here is what I did:

1) tried to compile testhst.pp and got error "cannot find unit netdb". Because I do not know the path of unit netdb, I do a search in <installdir> and find it in h:\Progs\Lazarus\180\fpc\3.0.4\source\packages\fcl-net\src\. So I add this path to the compiler settings of Lazarus.

2) next compile try gives error "cannot find unit BaseUnix used by netdb". This looks suspicious, because we are on Windows, but I do a search in <installdir> and get 3 matches (unix, beos and haiku of the rtl). I choose h:\Progs\Lazarus\180\fpc\3.0.4\source\rtl\unix\ and add this path to Lazarus.

3) next compile try gives error "cannot open ptypes.inc" used in unixtype.pp. A search gives 10 matches of different operating systems in the rtl (but without Windows). I choose h:\Progs\Lazarus\180\fpc\3.0.4\source\rtl\linux\ and add this Include-path to Lazarus.

4) next compile try gives error "cannot open ctypes.inc" used in ptypes.inc. I added h:\Progs\Lazarus\180\fpc\3.0.4\source\rtl\unix\

5) next compile try gives another error...

So I have 2 questions:
a) is example "testhst.pp" only for Unix, not for Windows? Where could I have recognized this?
b) is this stony way of try and error of adding search pathes step by step the "normal" way? Or did I something wrong?

I used Lazarus 1.8 RC5 with FPC 3.0.4 but had the same results with Lazarus 1.6.2 with FPC 3.0.0. Both on Windows 7 32 bit. Thanks in advance for your help.
« Last Edit: November 19, 2017, 06:31:12 pm by Hartmut »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
netdb is *nix only

(  fpcsrc\packages\fcl-net\fpmake.pp contains

Code: Pascal  [Select][+][-]
  1.  T:=P.Targets.AddUnit('netdb.pp',AllUnixOSes);

)

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Thank you very much, marcov, for your reply. I'm an absolute beginner to make files, so I had no chance to detect, that "testhst.pp" compiles only on *nix.

 

TinyPortal © 2005-2018