[Lazarus] Identifier not found, but code completion works....

Bo Berglund bo.berglund at gmail.com
Sat Feb 12 17:15:33 CET 2011


On Thu, 10 Feb 2011 23:41:27 +0100, Bo Berglund
<bo.berglund at gmail.com> wrote:

>unit1.pas(22,21) Error: Identifier not found "TSerial"

I finally managed to get my file recognized by *both* lazarus and fpc.
This is how:

1) In project inspector I *added* the Serial.pas file to the project.

2) In the Serial.pas file I added the following conditionals:
At the top of the file:
{$ifdef fpc}
  {$mode delphi}
{$endif}

further down I had to remove two uses files:
uses
  SysUtils,
  {$ifndef fpc}
  WinTypes,
  WinProcs,
  {$endif}

Now the test project compiles all right, but unfortunately it does not
work and I don't know if this is caused by:
- My PC has only one real serial port (in the docking station) so all
  others are via USB adapters.
- Some confusion caused by VMWare in my virtual machine when mapping
  com ports.
- My own shortcomings in using lazarus/fpc

I even copied the test program exe file over to my host and tried to
communicate via the serial ports to a Hyperterminal running on the
host using a null-modem cable between the real com port and one of the
USB ones. No go....
So this test with my old and proven Delphi serial component seems not
to work out, and it would not have sufficed anyways because I need
cross-platform compilation.

In any case right now I have only one working configuration for the
real project I am working on:
- Development in the virtual machine (no lazarus/FPC on the physical
laptop)
- Program uses COM1 in the virtual machine
- VMWare maps virtual machine COM1 to host COM1 (the real port)
- The other end of the connection is a simulator I am always using
when developing stuff and it connects to one of the USB ports (the
ATEN one is the only one working).

Seems to be a real bugger to get serial ports working properly and I
cannot rule out my laptop itself either. I got it in December and it
has Win7x64 whereas I always used WinXP-Pro for the last 8-9 years or
so. Maybe the Windows drivers are not up to speed?
The SUNIX device uses the Prolific serial converter chip and driver.
I think that basically it is a 4-way USB hub followed by 4 individual
Prolific RS232 converters in one box.

Has anyone here successfully used SdpoSerial in lazarus on Win7x64
towards a SUNIX ComHub 4-channel adapter???


Bo Berglund





More information about the Lazarus mailing list