Forum > Beginners

Serial unit missing

(1/9) > >>

kaimex:
Hi,
I just tried to compile the example program "TestSerialPortCom" taken from the page
https://wiki.lazarus.freepascal.org/Hardware_Access#FPC_built_in_Serial_unit
The accompanying text says
"Another serial unit is part of FreePascal since version 2.2.2: just put 'Serial' in the Uses list. However there does not seem to be any documentation other than the Serial.pp source file and some discussions.
An example using FPC 2.6.2 on WIN7. "
I am (still) using FPC V 2.6.0 under Windows 7 Home Premium 64 Bit.
The Compiler responds with "Can't find unit serial used by TestSerialPortCom".
The search function of Explorer++ does not find serial.pp on the disk.
Why is it not included contrary to the above statement "since version 2.2.2" ?
Is it only included when installed on 32 Bit versions of Windows ?
How can I get the serial unit ?

Regards Kai

lucamar:
In 2.6.0 it seems to be a Unix-only unit:
--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---lucamar@Diana:~/temp/fpcbuild-2.6.0$ find ./ -iname "serial.*"./fpcsrc/packages/amunits/src/coreunits/serial.pas./fpcsrc/packages/libndsfpc/src/nds/arm7/serial.inc./fpcsrc/rtl/unix/serial.pp./fpcdocs/olinuxex/serial.pp
Probably also in previous releases, though I don't have any at hand to check it.

Is there any reason why you can't update to a more modern version? 2.6.0 is almost ten years old by now. Lots of water have passed under the bridge ;)

PascalDragon:
Looks like the wiki article you linked is not entirely correct. While the Serial unit for *nix systems exists since essentially forever (at least since conversion to SVN, thus before 2.2.2), the Serial unit for Windows was added only rather recently (namely 3.0.0, so not 2.6.2 either). You could try to take the unit from trunk (click Download at the top). I think it should work with 2.6.0 as well as there weren't any fancy changes.

MarkMLl:
It went in at about 2.7.1, I think it sat in Mantis for quite a while after I submitted it. I forget the precise sequence of what went on 10+ years ago, but it's reasonable to expect that since it was in the development 2.7.1 it was backported into the (fixes release) 2.6.2, particularly if I was hassling people about it on the mailing list :-)

https://bugs.freepascal.org/view.php?id=18946

There have been no recent changes, but I don't think it's been tested against recent Windows. If OP does look at it, he should note the comments in the definition part about the change of flush/drain/sync behaviour, which is why I initially got involved.

I've considered some minor changes since then, but at present am not well set up for testing on Solaris which should also be good for the BSDs.

MarkMLl

PascalDragon:

--- Quote from: MarkMLl on June 04, 2021, 09:24:42 am ---It went in at about 2.7.1, I think it sat in Mantis for quite a while after I submitted it. I forget the precise sequence of what went on 10+ years ago, but it's reasonable to expect that since it was in the development 2.7.1 it was backported into the (fixes release) 2.6.2, particularly if I was hassling people about it on the mailing list :-)
--- End quote ---

It wasn't backported. The fixes tree for the 2.6.x series does not contain it.

Navigation

[0] Message Index

[#] Next page

Go to full version