FelixEcker / pasfetch

A System Fetch utility written completly in Pascal
ISC License
6 stars 3 forks source link

Identifier not found #3

Closed polluks2 closed 2 years ago

polluks2 commented 2 years ago

Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling src/PasFetch.pas
Compiling src/Logos.pas
Compiling src/uAnsiCrt.pas
Logos.pas(115,1) Warning: Function result variable does not seem to initialized
Logos.pas(132,1) Warning: Function result variable does not seem to initialized
PasFetch.pas(29,28) Error: Identifier not found "SplitString"
PasFetch.pas(44,34) Error: Identifier not found "SplitString"
PasFetch.pas(49,34) Error: Identifier not found "SplitString"
PasFetch.pas(54,34) Error: Identifier not found "SplitString"
PasFetch.pas(77,18) Error: Identifier not found "SplitString"
PasFetch.pas(77,30) Error: Identifier not found "SplitString"
PasFetch.pas(80,18) Error: Identifier not found "SplitString"
PasFetch.pas(101,18) Error: Identifier not found "SplitString"
PasFetch.pas(104,22) Error: Identifier not found "SplitString"
PasFetch.pas(108,30) Error: Identifier not found "SplitString"
PasFetch.pas(128,18) Error: Identifier not found "SplitString"
PasFetch.pas(169,14) Error: Identifier not found "SplitString"
PasFetch.pas(182,21) Error: Identifier not found "SplitString"
PasFetch.pas(198,16) Error: Identifier not found "SplitString"
PasFetch.pas(238,17) Error: Identifier not found "SplitString"
PasFetch.pas(251) Fatal: There were 15 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
mv: cannot stat 'out/PasFetch': No such file or directory
FelixEcker commented 2 years ago

Please provide more context like: OS, PasFetch version and where you are building this from (e.g. AUR package), with this alone I can't find any decernable reason for those Errors except for your FPC version being broken or a missing use in the source.

polluks2 commented 2 years ago

I know you have no BSD support, but compiling should be possible... NetBSD version 8.2 (netbsd@localhost) (gcc version 5.5.0) NetBSD 8.2 (GENERIC) #0: Tue Mar 31 05:08:40 UTC 2020

FelixEcker commented 2 years ago

This is very strange, could you, inorder to verify that the problem is not with your fpc installation, try to compile this test program and tell me if it compiles?

program Test;

uses StrUtils, SysUtils;

begin
  writeln(SplitString('foo bar', ' ')[1]);
end.
polluks2 commented 2 years ago

This seems to be the explanation


$ find /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/ -iname s??utils*
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/sysutils.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/sysutils.o
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas/strutils.o
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas/strutils.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas/strutils.rsj
FelixEcker commented 2 years ago

Ah, seems like strutils are only available in ObjectPascal. You could try adding the objfpc compiler flag (`{$mode objfpc}) to PasFetch.pas, that should allow it to use the strutils unit. I'm currently not sure if that flag conflicts with the delphi flag, but it is worth a try.

EDIT: The current source code does not work in Object Pascal mode because of some type mismatches between ShortStrings and AnsiStrings in PasFetch. You could still test what i stated above with my previous code example instead of pasfetch.

polluks2 commented 2 years ago

Indeed, Error: Mode switch "OBJFPC" not allowed here...

FelixEcker commented 2 years ago

Ok, but could you test compiling the example I gave above with the objfpc mode? If that works, I'll gladly refactor PasFetch to work in objfpc.

polluks2 commented 2 years ago

Well, the example cannot find StrUtils in both modes, rtl-objpas is not part of the path.


[0.105] (TEST)     Load from TEST (implementation) unit STRUTILS
[0.105] (STRUTILS) Loading unit STRUTILS
[0.105] Unitsearch: StrUtils.ppu
[0.105] Searching file StrUtils.ppu... not found
[0.105] Searching file strutils.ppu... not found
[0.105] Searching file STRUTILS.PPU... not found
[0.105] Unitsearch: StrUtils.pp
[0.105] Searching file StrUtils.pp... not found
[0.105] Searching file strutils.pp... not found
[0.105] Searching file STRUTILS.PP... not found
[0.105] Unitsearch: StrUtils.pas
[0.105] Searching file StrUtils.pas... not found
[0.105] Searching file strutils.pas... not found
[0.105] Searching file STRUTILS.PAS... not found
[0.105] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.ppu
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.ppu... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.ppu... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PPU... not found
[0.105] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pp... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PP... not found
[0.105] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pas... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PAS... not found
[0.105] Unitsearch: /usr/local/bin/StrUtils.ppu
[0.109] Searching file /usr/local/bin/StrUtils.ppu... not found
[0.109] Searching file /usr/local/bin/strutils.ppu... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PPU... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pp
[0.109] Searching file /usr/local/bin/StrUtils.pp... not found
[0.109] Searching file /usr/local/bin/strutils.pp... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PP... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pas
[0.109] Searching file /usr/local/bin/StrUtils.pas... not found
[0.109] Searching file /usr/local/bin/strutils.pas... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PAS... not found
[0.109] Unitsearch: StrUtils.pp
[0.109] Searching file StrUtils.pp... not found
[0.109] Searching file strutils.pp... not found
[0.109] Searching file STRUTILS.PP... not found
[0.109] Unitsearch: StrUtils.pas
[0.109] Searching file StrUtils.pas... not found
[0.109] Searching file strutils.pas... not found
[0.109] Searching file STRUTILS.PAS... not found
[0.109] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pp... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PP... not found
[0.109] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pas... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PAS... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pp
[0.109] Searching file /usr/local/bin/StrUtils.pp... not found
[0.109] Searching file /usr/local/bin/strutils.pp... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PP... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pas
[0.109] Searching file /usr/local/bin/StrUtils.pas... not found
[0.109] Searching file /usr/local/bin/strutils.pas... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PAS... not found
[0.109] xx.pas(4,16) Fatal: Can't find unit StrUtils used by Test
FelixEcker commented 2 years ago

ok this is most definetly a netbsd specific fpc bug and not with pasfetch.

polluks2 commented 2 years ago

Thanks, now it compiles with these paths:


-Fu/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/fcl-base
-Fu/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/fcl-process
-Fu/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas