Jump to content
Sign in to follow this  
Rollo62

[Fmx, Macos64] [dccosx64 Error] E2597 ld: warning: directory not found

Recommended Posts

I'm still testing porting from 10.3.1 to 10.3.2

In one FMX project for Macos, when just opening and compiling the working project, I've got some messages when compiling under Macos64

Quote

[dccosx64 Error] E2597 ld: warning: directory not found for option '-LC:\Users\reg_w\OneDrive\Dokumente\Embarcadero\Studio\20.0\Imports'
  ld: file not found: kernel32.dll
[dccosx64 Fatal Error] F2588 Linker error code: 1 ($00000001)
Failed

(Of coarse it works well under all other platforms).


1.) This message is strange, because the Imports folder is not there at all, not even the 20.0\ folder, because I installed the IDE under d:\Prj\...

Under d:\Prj\Embarcadero\Studio\20.0\Imports  I have that folder (which is almost empty, just a subfolder with one VCL related file "\Idl\StdVCL.idl".

2.) Its strange because of the reference to kernel32.-dll

I have searched my settings, compiler, linker, deployment, registry, but I'm not lucky and couldn't find where these locations are maybe set.

My BDSCOMMONDIR environment variable points to a folder close: C:\Users\reg_w\OneDrive\Dokumente\Embarcadero\Studio\20.0,

but thats working at all other platforms.

 

Then I decided to completely migrate via an new, empty project, like I described here:
Create new FMX app, removed orignal unit1 and added my units from the old project.
So now I got a more informative message, but still similar: compiling OK, linking failed

Quote

[dccosx64 Error] E2597 ld: warning: directory not found for option '-L\API'
  ld: warning: directory not found for option '-L\ComponentHelpers'
  ld: warning: directory not found for option '-L\Controls'
  ld: warning: directory not found for option '-L\Core'
  ld: warning: directory not found for option '-L\Features\Firebase'
  ld: warning: directory not found for option '-L\Features\NFC'
  ld: warning: directory not found for option '-L\Src\Features\Notifications'
  ld: warning: directory not found for option '-L\Include'
  ld: warning: directory not found for option '-LC:\Users\reg_w\OneDrive\Dokumente\Embarcadero\Studio\20.0\Imports'
  ld: file not found: kernel32.dll
[dccosx64 Fatal Error] F2588 Linker error code: 1 ($00000001)
Failed

The empty project runs, but when I add my units, something went wrong.

I'm not recalling to have anything affecting linking in my code, but I haven't checked that yet.

 

Which screw could I turn to remove this linker error, I hope somebody has a clue ?

 

Edit:

As usual, just when I prepare and sended a thread, it hits me in the face what this could be.

The folder seems to be related to Spring4D ..

To get Spring4D compiled, I used the following addition to switch to PUREPASCAL, which seemed to compile fine.
I'M using the development branch, from not too long ago (2 weeks), haven't checked for changes.

{$I Spring.inc}

{$IFDEF MACOS64}    // <--Addition
{$DEFINE  PUREPASCAL} 
{$ELSE}
{.$DEFINE PUREPASCAL} 
{$ENDIF  MACOS64}

unit Spring.Events;

So probably I have to c heck what happens with Spring4D in my Macos64 tests ...

 

How can I switch S4D  to Macos64 in the right way ?

 

Edited by Rollo62

Share this post


Link to post
2 hours ago, Rollo62 said:

  ld: warning: directory not found for option '-L\ComponentHelpers'
  ld: warning: directory not found for option '-L\Controls'
  ld: warning: directory not found for option '-L\Core'
  ld: warning: directory not found for option '-L\Features\Firebase'
  ld: warning: directory not found for option '-L\Features\NFC'
  ld: warning: directory not found for option '-L\Src\Features\Notifications'

Those paths look suspiciously like mine in Kastri Free. What exactly are you compiling?

2 hours ago, Rollo62 said:

ld: file not found: kernel32.dll

I suggest checking whether you have a unit that references the DLL without having a conditional define, or that the path to it is included for macOS when it should not be

Share this post


Link to post
3 hours ago, Rollo62 said:

So probably I have to c heck what happens with Spring4D in my Macos64 tests ...

 

How can I switch S4D  to Macos64 in the right way ?

 

There is a commit from yesterday on Bitbucket, so I think you should update......

Share this post


Link to post

@Dave Nottage

Well thanks, perfect tip again.
I was alrerady diving deep in other tasked, but I just doublechecked this.

There was a well hidden reference in OSX-specific code (typical copy-paste problem :classic_blush:)

 

This reference  was nicely separated in its own OSX unit

uses
  {$IF Defined(IOS)}
      Sys.Power.WakeLock.Impl.iOS
  {$ELSEIF Defined(ANDROID)}
      Sys.Power.WakeLock.Impl.Android
  {$ELSEIF Defined(MSWINDOWS)}
      Sys.Power.WakeLock.Impl.Win
  {$ELSEIF Defined(MACOS)}
      Sys.Power.WakeLock.Impl.OSX
  {$ELSE}
    {$MESSAGE Error 'IWakeLock not supported on this platform'}
  {$ENDIF}
    ;

 

but unfortunately the hidden reference resides in a region

unit Sys.Power.WakeLock.Impl.OSX;

....

{$REGION 'Windows helper functions'}

function SetThreadExecutionState(esFlags: EXECUTION_STATE): EXECUTION_STATE; stdcall; external 'kernel32.dll';

{$ENDREGION}

So this was hardly visible, if region was not expanded.

Anyway, it was just this line, never used in the unit at all.

Thats a good reason why I tend to avoid regions usually, and here I had one of the few places where I still used it by accident.

 

I wonder why this never got any message/warning/hint/ under Macos32 ?
Maybe Macos can make use of Windows kernel32.dll somehow :classic_biggrin:

 

Thanks for pointing me in the right direction.

 

:classic_cheerleader: App is running now normally under Macos64 ( w/o any changes),
even with the dirty Spring4D fix,
and more important for me with Bluetooth LE support running at same code under Macos32/64 Bit (which was my biggest worry for me).
Looks very good, need more time to test, but so far all is running out of the box.

 

At compiletime I still get a warning:

Quote

[dccosx64 Hint] H2596 ld: warning: directory not found for option '-LC:\Users\reg_w\OneDrive\Dokumente\Embarcadero\Studio\20.0\Imports'

So maybe one day I find where this reference is, but for now I will check and test the more important parts.

 

@Fritzew

Thanks for the info, then I will be able re-test all my Spring4D related code soon.

Since I already postponed this to the latest possible moment, and just started with the first project.

 

 

Edited by Rollo62
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×