[fpc-pascal] Lazarus complains that it cannot find a dependency, why?

Tomas Hajny XHajT03 at hajny.biz
Tue Sep 1 23:55:08 CEST 2020


On 2020-09-01 23:44, Bo Berglund via fpc-pascal wrote:
> On Tue, 01 Sep 2020 22:46:55 +0200, Bo Berglund via fpc-pascal
> <fpc-pascal at lists.freepascal.org> wrote:


Hi,

> Further to this mystery:
> If I remove LazSerialPort from the dependencies and instead put
> SdpoSerialLaz there instead it also solves the problem:
> - Program builds fine
> - Program does not crash when the read thread is created.
> 
> But remove this so the only dependency is LCL then the program builds
> but crashes when the read thread is created after the serial port has
> been opened.

Well, I believe that this supposed mystery may be resolved easily. ;-) 
First of all - have you tried to find out what does the displayed error 
number (232) mean? Quick searching reveals that runtime error 232 may 
signalize that you try to use threads without having a thread manager 
included in your application. Under Linux/Unix, you can add a thread 
manager by adding unit cthreads to the uses section of your program. 
That also provides explanation of your "mystery" - the other 
dependencies tried by you included this unit by themselves and thus you 
didn't need to do so in your program.

Hope this helps

Tomas


More information about the fpc-pascal mailing list