[SOLVED] Making projects compilable under Windows and Linux? lazarus / 31-LCL ---------------------------------------------------------------------- knuckles · 2016-12-29 15:38 I am just starting out with experimenting on simple test projects that can be built and run under Windows and Linux and there is something which I am unsure about. One of my test projects under Windows 10 I use things like these for example: QuoteRGB, GetRValue, GetGValue, GetBValue, GetSysColor I believe all of these are in the Windows.pas unit. Obviously you cannot use the Windows unit under Linux which also means I can no longer use the above. So my question is how would I be able to use functions and procedures from the Windows unit under Linux? Do I manually need to copy and paste parts from the Windows unit that I need into my own unit or is there some better way? Thanks ---------------------------------------------------------------------- VTwin · 2016-12-29 15:55 Best to not use the Windows unit at all. I'm not sure what you need to do, but I write cross-platform graphics intensive programs that compile on Windows, Mac, and Linux. See here: http://wiki.freepascal.org/Developing_with_Graphics but, I mostly use the excellent BGRABitmap: http://wiki.freepascal.org/BGRABitmap Cheers, VTwin ---------------------------------------------------------------------- knuckles · 2016-12-29 16:27 Thanks, those were just examples though. What I mean is if I need functions from Windows unit, and I cannot use that unit under Linux can I just take parts out of it and put into my own unit or is there other way? I need to use some things from Windows unit but cannot use this unit under Linux so I was unsure how best to approach it. I don't need other libraries etc just a few things from Windows unit. ---------------------------------------------------------------------- Phil · 2016-12-29 16:30 Quote from: knuckles on December 29, 2016, 05:27:08 pmI don't need other libraries etc just a few things from Windows unit. In your form units, instead of Windows and Messages, use the cross- platform units LclIntf, LMessages and LclType. See documentation, wiki, etc. ---------------------------------------------------------------------- lainz · 2016-12-29 16:30 What you exactly need? We can't give you a cross platform unit to replace Windows if you don't say what you need. And no, you can't copy and paste stuff from the Windows unit, because these will use .dll's that are available only under Windows system. ---------------------------------------------------------------------- knuckles · 2016-12-29 17:59 LCLIntf instead of Windows uses clause worked thanks Phil, will look for the wiki page for extra reading / more info.