Lazarus

Programming => General => Topic started by: Sandstone on October 27, 2020, 04:33:02 pm

Title: [SOLVED} Need Help WIth strings.pp
Post by: Sandstone on October 27, 2020, 04:33:02 pm
I am working on compiling an application and have come to something I don't understand. I get the error message on {$i strings.inc } that strings.pp(109,2) Fatal: Cannot open include file "strings.inc". When I click on show the declaration, It pulls up the correct strings.inc file (attached.)
Title: Re: Need Help WIth strings.pp
Post by: PascalDragon on October 28, 2020, 09:25:34 am
I am working on compiling an application and have come to something I don't understand. I get the error message on {$i strings.inc } that strings.pp(109,2) Fatal: Cannot open include file "strings.inc". When I click on show the declaration, It pulls up the correct strings.inc file (attached.)

Can you show the parameters that Lazarus passes to the compiler? See Project -> Project Settings -> Show settings (at the bottom). I have the feeling that someone passes a path to the source files of FPC which should not be the case.
Title: Re: Need Help WIth strings.pp
Post by: Sandstone on October 28, 2020, 06:27:30 pm
usr/bin/fpc
-MDelphi
-Scghi
-Cg
-O1
-g
-gl
-l
-vewnhibq
-Filib/x86_64-linux
-Fu/usr/share/fpcsrc/3.2.0/rtl/inc
-Fu/usr/share/lazarus/2.0.10/components/virtualtreeview/lib/x86_64-linux-gtk2
-Fu/usr/share/lazarus/2.0.10/components/ideintf/units/x86_64-linux/gtk2
-Fu/usr/share/lazarus/2.0.10/components/lclextensions/lib/x86_64-linux-gtk2
-Fu/usr/share/lazarus/2.0.10/components/lazcontrols/lib/x86_64-linux/gtk2
-Fu/usr/share/lazarus/2.0.10/lcl/units/x86_64-linux/gtk2
-Fu/usr/share/lazarus/2.0.10/lcl/units/x86_64-linux
-Fu/usr/share/lazarus/2.0.10/components/lazutils/lib/x86_64-linux
-Fu/usr/share/lazarus/2.0.10/packager/units/x86_64-linux
-Fu.
-FElib/x86_64-linux
-olib/x86_64-linux/OrganBuilder
-dLCL
-dLCLgtk2
-dBorland
-dVer150
-dDelphi7
-dCompiler6_Up
-dPUREPASCAL
Title: Re: Need Help WIth strings.pp
Post by: Handoko on October 28, 2020, 06:54:55 pm
I can reproduce same error message if I add this:
/usr/share/fpcsrc/3.2.0/rtl/inc
in to Other unit files (-Fu).

Lazarus main menu > Project > Project Options > Compiler Options > Paths > Other unit files (-Fu)

Tested on Lazarus 2.0.10 Linux GTK2.
Title: Re: Need Help WIth strings.pp
Post by: Sandstone on October 28, 2020, 08:19:59 pm
OK, I took that out and I get something along another line: Organ.pas(523,22) Error: Identifier not found "TSize"
I thought that by adding the path /usr/share/fpcsrc/3.2.0/rtl/inc the compiler would pick up the definitions typshrdh.inc and typshrd.inc
Is this in one of the Lazarus packages?
Title: Re: Need Help WIth strings.pp
Post by: bytebites on October 28, 2020, 09:21:36 pm
Unit Types
Title: Re: Need Help WIth strings.pp
Post by: Sandstone on October 29, 2020, 03:42:07 am
Thanks, that got me moving again. Running into other issues but I'm managing to work them out. AFAIK this code was only built for Windows by the original author (long gone.) I've been running it using PlayOnLinux but would like to be able to build it on Linux.  :(
Title: Re: Need Help WIth strings.pp
Post by: PascalDragon on October 29, 2020, 09:16:17 am
OK, I took that out and I get something along another line: Organ.pas(523,22) Error: Identifier not found "TSize"
I thought that by adding the path /usr/share/fpcsrc/3.2.0/rtl/inc the compiler would pick up the definitions typshrdh.inc and typshrd.inc
Is this in one of the Lazarus packages?

No, if a type is missing you don't add paths to the project, you add units to the uses-clause of the unit where the type is missing.

Thanks, that got me moving again. Running into other issues but I'm managing to work them out. AFAIK this code was only built for Windows by the original author (long gone.) I've been running it using PlayOnLinux but would like to be able to build it on Linux.  :(

In that case I'd suggest you to first build it for Windows (if you don't have a Windows yourself you can either prepare a Win32 cross compiler from Linux or you can simply install Lazarus for Windows in Wine) to check whether it works correctly and then tackle the problem of porting it to Linux.
Title: Re: Need Help WIth strings.pp
Post by: Sandstone on October 29, 2020, 08:10:00 pm
Thanks to everyone! I installed Lazarus in PlayOnLinux and it worked great! I found out that the issue is not with trying to compile in Linux -- the Delphi source code I found was buggy. I had the same compile errors in the Windows version. Also, it wasn't mentioned that there was a class TAudioPlayer used from the Delphi Wave Audio package  >:D
I'm going back to trying to build in Linux. My thought is to replace TAudioPlayer with something else that will play a WAV file in ALSA.
TinyPortal © 2005-2018