I just want to learn nim learning by doing. Unfortunately my first project uses the serial port. Therefore I wrote requires "serial >= 1.1.2" into my test.nimble file. Build the project with my ubuntu-nim-compiler (0.17.2) I got an error, same as described in https://github.com/euantorano/serial.nim/issues/12 . Ok, I removed the ubuntu-nim and downloaded the latest version of nim, compiled it successfully. But compiling the serial module I stuck again, with this error:
... Hint: epoll [Processing]
... Hint: serialstream [Processing]
... /home/woody/.nimble/pkgs/serial-1.1.2/serial/serialstream.nim(117, 17) Error: type mismatch: got <proc (s: Stream, buffer: pointer, bufLen: int): int{.gcsafe, locks: <unknown>.}> but expected 'proc (s: Stream, buffer: pointer, bufLen: int): int{.gcsafe.}'
... .raise effects differ
I have no idea what to do, please help!
Thanks, Mark
latest error hint is .raise effects differ.
So try cloning the serial.nim libray and fix the raised error types (in serialport_common.nim change InvalidSerialPortError, InvalidSerialPortStateError, etc. from object of Exception into object of IOError). Then nimble install from within (serial.nim) to overwrite (till original lib gets adjusted) the local installation.
Error: type mismatch: got <proc (s: Stream, buffer: pointer, bufLen: int): int{.gcsafe, locks: <unknown>.}> but expected 'proc (s: Stream, buffer: pointer, bufLen: int): int{.gcsafe.}'
.raise effects differ
I could not avoid that error no matter what pragmas I manually allocated to the user implementations of user implementation (i.e. spReadData). When I said "try this" I meant "it worked for me".
Alternative suggestions that make that library compile welcome.