Recent

Author Topic: MacOsX 10.14.5/Laz 2.0.2/QT5: "ld: framework not found Qt5Pas" [SOLVED]  (Read 567 times)

bigDan

  • New Member
  • *
  • Posts: 32
Hi,

I upgraded to Laz 2.0.2 on an older Mac El Capitan with QT5 and it compiles fine.

This past week I updated a different Mac to Mojave(10.14.5), then installed Laz 2.0.2 and QT5 (following the instructions at http://wiki.lazarus.freepascal.org/Qt5_Interface or https://web.archive.org/web/20181011055409/http://wiki.lazarus.freepascal.org/Qt5_Interface).

When I compile my normal code, compilation fails with

ld: framework not found Qt5Pas

I built a completely empty project, attempted to compile and get the same error.

I have spent many hours trying to figure out what is different (other than the newer version of Mac OS and xcode).

The Qt5Pas framework is located at /Library/Frameworks in both systems. Yet somehow the new system cannot find it.

All lazarus settings (Tools | Options and Project | Options) are identical between the 2 systems. I have no special search paths set up on either system.

I cannot, for the life of me, understand why the Qt5Pas framework is found on one system but not the other.

Does anyone know why this would be happening. Does anyone else have QT5 and 10.14.5 running?
« Last Edit: June 01, 2019, 06:08:14 am by bigDan »

zeljko

  • Hero Member
  • *****
  • Posts: 1054
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: MacOsX 10.14.5/Laz 2.0.2/QT5: "ld: framework not found Qt5Pas"
« Reply #1 on: May 31, 2019, 06:51:56 pm »
Probably you have old Frameworks/Qt5Pas, you should remove that directory and copy new one which you compiled.

bigDan

  • New Member
  • *
  • Posts: 32
Re: MacOsX 10.14.5/Laz 2.0.2/QT5: "ld: framework not found Qt5Pas"
« Reply #2 on: May 31, 2019, 06:58:37 pm »
The Qt5Pas framework didn't already exist on this new machine, but I just checked and all dates are as of May 26, when I compiled Qt5.

zeljko

  • Hero Member
  • *****
  • Posts: 1054
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: MacOsX 10.14.5/Laz 2.0.2/QT5: "ld: framework not found Qt5Pas"
« Reply #3 on: May 31, 2019, 10:38:06 pm »
hm that's pretty strange if lazarus works ok with same framework, try to add linker option -framework Qt5Pas -lobjc

bigDan

  • New Member
  • *
  • Posts: 32
Re: MacOsX 10.14.5/Laz 2.0.2/QT5: "ld: framework not found Qt5Pas"
« Reply #4 on: June 01, 2019, 01:03:07 am »
lazarus is using Cocoa. If I attempt to recompile lazarus with Qt5 it will get the same error (ld: framework not found: Qt5Pas)

I tried adding '-framework Qt5Pas -lobjc' and that made no difference.

I reverted to Xcode 10.1 / commandLineTools 10.1 as well w/o any difference.

I realized I had access to a 10.14.0 system so I tried on it (running XCode 10.1 as well) and it gets the same issue, so it isn't 10.14.5's fault, seems to be Mojave in general.

I barely understand Mac, having only started porting my project to it in the past 6 months. I don't understand the mechanism that searches frameworks, but it seems that path or whatever is not being searched or is wrong.

bigDan

  • New Member
  • *
  • Posts: 32
Found the solution. To Project Option 'Pass options to linker', added:

-F/Library/Frameworks

The -F option indicates to add a directory to the framework search path.

I was able to determine the problem by using the compiler generated link.res and ppaslink.sh files. I manually linked the program until I was able to resolve the issue.

It makes no sense that I should have to do this. All documentation indicates that /Library/Frameworks is the first location searched, but for some reason that is not happening on either of my 2 Mojave systems while the El Capitan system works fine.