ITADN

transgui failed to build with lazarus 4.0 on Linux

#1486Openbassmadrigal 创建于 2025-05-14
B
bassmadrigalcommented
The SlackBuilds.org package maintainer for lazarus notified me that transgui was failing to build when he was testing packages against their updated lazarus package (to 4.0) with the following error: `Error: (5000) Identifier not found "INVALID_HANDLE_VALUE" ` Upon researching, I found that [main.pas:1262](https://github.com/transmission-remote-gui/transgui/blob/8854357ece266e749e8981a93c8002465a93d8f2/main.pas#L1265C13-L1265C21) contained INVALID_HANDLE_VALUE, which seems to be undefined in Linux as it is win32 specific code. I am not sure why it worked fine with older versions of lazarus. I eventually found I could work around this by switching that constant to something cross-platform. This changes this `if h <> INVALID_HANDLE_VALUE then begin` to this `if h >= 0 then begin` I added this sed command to the SlackBuild so it can be automated by others building it: `sed -i 's|h <> INVALID_HANDLE_VALUE|h >= 0|' main.pas` I'd submit a PR, but this project seems (unfortunately) somewhat dead, so I added this as a reference for others to find if they come across a similar issue.
3 条评论