Recent

Author Topic: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes  (Read 2260 times)

kevin.black

  • Full Member
  • ***
  • Posts: 121
DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« on: April 21, 2019, 03:19:16 am »
Hi,

Again, maybe this is simple, I've wasted a couple of days and no further forward. And maybe this should be on the fpcupdeluxe forum pages since it is a difference between the RC and a more recent release.

I was advised on the forum to move from 2.0.0RC3 to Fixes / Fixes (2.0.1 / 3.2.0) because of an issue I've was having (I cannot even remember what it was).

I am now having issues with a DYLIB not found (it's one I create). With 2.0.0RC3 the DYLIB is found and the test app builds, with the same project and building with fixes/fixes, I always get the error that the DYLIB cannot be found. The settings for the projects in each version are the same. I have set 'Use Application Bundle' and have created it and have ticked 'Apply Convention':

Code: Pascal  [Select][+][-]
  1. Messages, Warnings: 17, Hints: 78
  2. Warning: other unit files search path (aka unit path) of "EMPServerAPITest" contains "/Users/kevin/Dropbox/Lazarus Components/TMSLCLCloudLazarusPkgReg", which belongs to package "LCLTMSCloudLazarusPkg"
  3.  
  4. (*
  5.     SNIP.....
  6. *)
  7.  
  8. (9001) Assembling (pipe) /Users/kevin/Dropbox/Lazarus/EMPSecureRESTAPI/lib/x86_64-darwin/uempservertest.s
  9. (9001) Assembling (pipe) /Users/kevin/Dropbox/Lazarus/EMPSecureRESTAPI/lib/x86_64-darwin/EMPServerAPITest.s
  10. (9022) Compiling resource /Users/kevin/Dropbox/Lazarus/EMPSecureRESTAPI/lib/x86_64-darwin/EMPServerAPITest.or
  11. (9015) Linking /Users/kevin/Dropbox/Lazarus/EMPSecureRESTAPI/x86_64-darwin/EMPServerAPITest
  12. ld: library not found for -ldbxserverapi
  13. An error occurred while linking
  14. Error: (9013) Error while linking
  15. Fatal: (10026) There were 1 errors compiling module, stopping
  16. Fatal: (1018) Compilation aborted
  17. Error: /Users/kevin/fpcupdeluxe/fixes/fpc/bin/x86_64-darwin/ppcx64 returned an error exitcode
  18.  
I have the DYLIB path set to the app folder, but have copied both libDYLIBNAME.dylib and DYLIBNAME.dylib to /usr/local/lib as well.

I know the only difference should be the IDE Tools->Options since the Project Group and projects(s) settings are common.

I have the following compiler directives in both and am defining the DYLIB as below. As noted, no issue in 2.0.2RC3, but cannot find the DYLIB in fixes/fixes.

My Question: Can anyone point me in the direction of what I should be looking for that might be the difference between the two versions that would cause the DYLIB not to be found, please?

Code: Pascal  [Select][+][-]
  1. unit uEMPServerTest;
  2.  
  3. {$mode objfpc}{$H+}
  4. {$ModeSwitch Unicodestrings}
  5. {$ModeSwitch pChartoString}
  6.  
  7. interface
  8.  
  9. uses
  10.  
  11. (*
  12.     SNIP.....
  13. *)
  14.  
  15.   {$IFDEF MSWINDOWS}
  16.   EmpyreanAPIDLL = 'DbXServerAPI.dll';
  17.   {$ENDIF MSWINDOWS}
  18.   {$IFDEF DARWIN}
  19.   EmpyreanAPIDLL = 'libdbxserverapi.dylib';
  20.   {$linklib libdbxserverapi.dylib}
  21.   {$ENDIF DARWIN}    

I'm happy to provide more/all of the code if required/needed. I just did not want a 20 page question when the real issues is that the test application builds with 2.0.0RC3 and does not build with Fixes/Fixes.

Thanks,
Kevin
« Last Edit: April 21, 2019, 03:53:21 am by kevin.black »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #1 on: April 21, 2019, 01:43:53 pm »
I am going to shoot from the hip and say that if it's a UNIT file, then its the wrong version.

I say this because you made a comment about upgrading to 3.2.0 compiler.

if you are indeed only pointing to UNIT and not source for that unit then maybe that's the issue.

I don't know what DYLIB is but I can only assume it's a UNIT..

Try recompiling the DYLIB maybe?
The only true wisdom is knowing you know nothing

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #2 on: April 21, 2019, 01:57:00 pm »
I don't know what DYLIB is but I can only assume it's a UNIT..
dylib is dynamic library Is like dll but then MacOS (is not good page but explain dylib http://wiki.freepascal.org/Lazarus/FPC_Libraries#Operating_Systems any platform)

Quote
Try recompiling the DYLIB maybe?
That can be. Maybe keven.black start use 32 bit compiler and now use 64 bit compiler ?

Not found is not good error. May be try see linker script and see were is look dylib ?

kevin.black

  • Full Member
  • ***
  • Posts: 121
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #3 on: April 23, 2019, 12:16:55 am »
Thanks for the responses.

The DYLIB has been recompiled, using fixes / fixes. When I try to build the test application I get the link error DYLIB not found error. It's not (AFAICT) a versions issue, the test app and the dylib have exactly the same settings and are built for x64_86 / Darwin, ie. 64 bit macOS. Again, the build settings are identical, and FWIW, exactly the same as the build settings when I build for 2.0.0RC3?

I could understand if it wasn't MY DYLIB, but I build it and I have put it in the default macOS folder (/usr/local/lib) and in the App folder.

As noted, it's a NOT FOUND error during linking. I'm not clever enough to take this much further, I've done all of the reasonable things I think.

Again, thanks for the advice.

Kevin

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #4 on: April 23, 2019, 12:30:56 am »
I have put it in the default macOS folder (/usr/local/lib) and in the App folder.
As noted, it's a NOT FOUND error during linking.

Not sure, but on linux, this would call for running
Code: [Select]
ldconfignot sure if any args needed

kevin.black

  • Full Member
  • ***
  • Posts: 121
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #5 on: April 23, 2019, 01:11:51 am »
Hi Martin,

What's ldConfig?

And the confusing thing is that it links with 2.0.0RC3 and not fixes / fixes. The question is, I guess, what's different between the two installations of Lazarus / FPC? and I cannot see any (obviously there are). The settings for the project group and projects is the same, those settings are held within the project. I've looked at the Lazarus->Tools->options for both installations and they seem the same so I'm a bit lost?

Kevin


kevin.black

  • Full Member
  • ***
  • Posts: 121
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #7 on: April 23, 2019, 02:51:39 am »
Thanks dsiders.

Whilst I understand that macOS has its roots in Unix, is this necessary and should I be executing ldconfig on some sort of regular basis?

EDIT:

So in either lazarus / FPC install on my mac there is no file called ldconfig. Specifically there is no file in  any of the sbin folders as suggested in the help (/sbin/ldconfig).

I'm thinking it is for a unix / linux installation of Lazarus / FPC?

Kevin
« Last Edit: April 23, 2019, 02:59:42 am by kevin.black »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki

kevin.black

  • Full Member
  • ***
  • Posts: 121
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #9 on: May 02, 2019, 01:56:03 am »
@Martin_fr,

Did that and did as was suggested in the answer which did seem to update the cache, but to no avail, same issue.

Just to backpedal and set the scene:
  • RC3 was installed for Darwin x86_64
  • Fixes / Fixes was installed for Darwin x86_64
  • The Dylib is built for cocoa Darwin x86_64
  • The Dylib test application (the one with the link issues) is built for cocoa Darwin x86_64
  • The Dylib test application has the Application Bundle created
  • Since I am using the same project group/project files all of the paths for the DYLIB/Test program are the same
  • Just to be doubly sure I copied the DYLIB to the default DARWIN DYLIB repository (/usr/local/lib)
  • I further installed Trunk / Trunk
  • Exactly the same issue

So the question remains: Why can the RC3 version find the DYLIB and link, yet Trunk/Trunk and Fixes/Fixes cannot?

Note that the PATHS and CONFIGURATION (as in: the project options) are the same. So if the library (and all other) paths are detailed and are the same, why can RC3 find and link the dylib and the other two installs not find the dylib? The only area that is specific to the installation is the TOOLS->OPTIONS, but I have compared that pretty much line for line and there is either nothing different or nothing that would interfere with linking a dylib.

I have also renamed/ copied to libdbxserverapi.dylib, DbXServerAPI.dylib abd DbXServerAPI to no avail.

Looking at the messages during the build, the only time the dylib is mentioned is right at the end when it cannot be found. In the RC3 version the DYLIB is never mentioned not even that it has successfully been linked.

Any ideas appreciated or any ideas where to look (ie. is there / are there any config files that 'could?' be different for example).

Kevin
« Last Edit: May 02, 2019, 02:03:01 am by kevin.black »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: DYLIB found under las 2.0.0RC3 NOT FOUND Under Fixes/Fixes
« Reply #10 on: May 02, 2019, 02:38:13 am »
I can only take guesses....  I googled a bit for a diff approach.

Under Project > Project Options > Compilation and linking: There is a field "Pass options to linker"

Maybe try some of the verbose options
https://www.unix.com/man-page/osx/1/ld/

-t
-why_load

Start trying with one at a time. Not sure if you need "t" or "-t"

With a bit of luck, maybe the linker is giving some useful info back....

 

TinyPortal © 2005-2018