Recent

Author Topic: [SOLVED] dirutils error  (Read 558 times)

spassigl

  • New Member
  • *
  • Posts: 25
[SOLVED] dirutils error
« on: March 28, 2025, 11:05:00 am »
I've picked up again a project I was developing on a Linux machine, that compiled without errors, and now moved it to an OSX machine, MacBook Pro with Sequoia 15.3 OS.

When building the project I get the following error

dirutils.pas(77,85) Error: Call by var for arg no. 4 has to match exactly: Got "FILES.FSRef" expected "MACOSALL.FSRef"
dirutils.pas(79,85) Error: Call by var for arg no. 4 has to match exactly: Got "FILES.FSRef" expected "MACOSALL.FSRef"

This is the code in dirutils

Code: Pascal  [Select][+][-]
  1.       if Global then   // kLocalDomain
  2.         theError := FSFindFolder(kLocalDomain, FolderType, kDontCreateFolder, theRef)
  3.       else             // kUserDomain
  4.         theError := FSFindFolder(kUserDomain , FolderType, kDontCreateFolder, theRef);
  5.  

Any idea on how to get past this?
« Last Edit: March 28, 2025, 01:51:57 pm by spassigl »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12153
  • FPC developer.
Re: dirutils error
« Reply #1 on: March 28, 2025, 11:35:16 am »
Afaik the idea is to either use macosall, or the separate units, never both. Adjust your uses clauses accordingly.

spassigl

  • New Member
  • *
  • Posts: 25
Re: dirutils error
« Reply #2 on: March 28, 2025, 11:40:13 am »
Afaik the idea is to either use macosall, or the separate units, never both. Adjust your uses clauses accordingly.

My code only uses dirutils. The error happens when I build the project and dirutils is compiled.

cdbc

  • Hero Member
  • *****
  • Posts: 2099
    • http://www.cdbc.dk
Re: dirutils error
« Reply #3 on: March 28, 2025, 12:08:42 pm »
Hi
Hmmm... You could try to:
Code: Pascal  [Select][+][-]
  1. uses classes, sysutils,{$ifdef MACOS}macosall,{$else}dirutils{$endif};
...and see if that would help?!?
Just an idea.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

spassigl

  • New Member
  • *
  • Posts: 25
Re: dirutils error
« Reply #4 on: March 28, 2025, 12:53:29 pm »
Hi
Hmmm... You could try to:
Code: Pascal  [Select][+][-]
  1. uses classes, sysutils,{$ifdef MACOS}macosall,{$else}dirutils{$endif};
...and see if that would help?!?
Just an idea.
Regards Benny

So I managed to get past the error with this

Code: Pascal  [Select][+][-]
  1. {$ifdef DARWIN}macosall,{$else}dirutils{$endif};
  2.  
But now the compiler complains about GetConfigurationDir

mainform.pas(287,18) Error: Identifier not found "GetConfigurationDir"

as dirutils is not included.

« Last Edit: March 28, 2025, 12:55:14 pm by spassigl »

cdbc

  • Hero Member
  • *****
  • Posts: 2099
    • http://www.cdbc.dk
Re: dirutils error
« Reply #5 on: March 28, 2025, 01:09:26 pm »
Hi
Is that the only complaint, then just copy that function into your own code and 'ifdef' that too...
...or, replace that call with 'GetAppConfigDir();' from sysutils...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

spassigl

  • New Member
  • *
  • Posts: 25
Re: [SOLVED] dirutils error
« Reply #6 on: March 28, 2025, 01:52:38 pm »
Hi
Is that the only complaint, then just copy that function into your own code and 'ifdef' that too...
...or, replace that call with 'GetAppConfigDir();' from sysutils...
Regards Benny

Thanks I'll do that.

 

TinyPortal © 2005-2018