Serial in uses not found lazarus / 62-General ---------------------------------------------------------------------- Ruptor · 2015-08-16 22:39 I have created a program with the example code from the wiki that uses the FPC internal serial code but the compiler says "Cannot find serial used by unit1". It seemed like a simple piece of test code that would get me off the ground but it can't find itself let alone run. Any suggestions since serial is supposed to have been part of FPC since version 2.2.2 and I am running 2.6.4 svnr 48774 under Laz 1.4.0? ---------------------------------------------------------------------- ChrisF · 2015-08-16 23:07 There is an (old) serial.pp unit, but it's for Unix. May be you're using Windows or any non Unix/Linux OS, aren't you ? ---------------------------------------------------------------------- Ruptor · 2015-08-17 00:11 Hi Chris The example is here and says it is for Win7 http://wiki.lazarus.freepascal.org/Hardware_Access Section 4.4 FPC built in serial unit. ---------------------------------------------------------------------- ChrisF · 2015-08-17 02:24 Well, apparently the windows unit is not present in all FPC source releases (absent into the current 2.6.4 release). But it's present into the current trunk version. So, you can download only it from here, for instance (Graemeg's mirror): https://github.com/graemeg/freepascal/blob/master/packages/rtl- extra/src/win/serial.pp or from the FPC SVN repository if you already use it (in ...\packages\rtl-extra\src\win). ---------------------------------------------------------------------- marcov · 2015-08-17 09:16 It might only be starting with 3.0.0. At least 3.x compiles serial for  android,linux,netbsd,openbsd,win32 and win64 ---------------------------------------------------------------------- Ruptor · 2015-08-17 09:48 Ok Guys thanks. What is your recommendation for a route to getting a simple cross platform serial port to work. Is it get FPC 3.x, Synaser, 5dpo, or Tlazserial? Like always there is an infinite number of things that seem to do the same thing and it confuses my poor little brain. ---------------------------------------------------------------------- Jurassic Pork · 2015-08-17 10:54 hello, what do you want to do with your serial access ? is it for a console or a gui  application ? ---------------------------------------------------------------------- Ruptor · 2015-08-17 11:07 A GUI for talking to a frequency generator on a serial to USB adapter then maybe multiple adapters. Why does it make a difference isn't a program a program whether it has a GUI or not? I am not an expert high level programmer my background is embedded so to me code is just a flow of bits and what it looks like at the top doesn't really matter. Oh is it that the operating system gets in the way with a GUI but not with a console program? ---------------------------------------------------------------------- Jurassic Pork · 2015-08-17 11:31 TLazserial is a visual component only for GUI application  . It uses synaser as serial  library. ---------------------------------------------------------------------- marcov · 2015-08-17 12:05 Quote from: Ruptor on August 17, 2015, 01:07:12 pmWhy does it make a difference isn't a program a program whether it has a GUI or not? Most GUI models keep the main thread free for GUI events. Usually there is  some support for asynchronous components though. Either for asynchronous support in the OS (usually Windows) or emulating it using a thread (read: *nix) If you want the easiest way you need to honour this difference. If you are a die hard, just stick the component in the thread and arrange your communication between GUI and the  thread. ---------------------------------------------------------------------- Ruptor · 2015-08-17 18:27 Thanks for the explanation Marcov. I found this that has Lazarus & FPC 3 so I can try it with the example Serial unit. http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-New- FPC-3-0-and-Lazarus-1-4-Test-Installer-td4040074.html It also has Arm cross compiler stuff that I want to use so that's neat too.