Recent

Author Topic: OSX Cross Compiling for Cocoa X86-64  (Read 3923 times)

mac01

  • New Member
  • *
  • Posts: 15
OSX Cross Compiling for Cocoa X86-64
« on: September 30, 2016, 10:51:08 pm »
Good Evening,

Hopefully this is something simple that I am missing.

I have been using 1.4.4 for a while now; just playing really for my own amusement.

I thought I would try the latest trunk 1.7, 3.1.1. I found the getlazarus site via this forum and used the script to download 1.7, 3.1.1

So far so good, I can compile using the carbon widgetset; small bug with the drop down widgetset; but I remember reading some post how to fix that.

To the question, I then tried to compile for COCOA widgetset, I can change to cocoa, but when I tel compiler to coile for 64 bit; i get message saying that ppc64 is not installed.

What is the easiest way to just add the x86-64 compiler for osx (3.1.1) to the installation created by getlazarus script.

Hope that all makes sense.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: OSX Cross Compiling for Cocoa X86-64
« Reply #1 on: October 02, 2016, 04:41:11 pm »
What is the exact error message? ppc64 is not a valid compiler name.

mac01

  • New Member
  • *
  • Posts: 15
Re: OSX Cross Compiling for Cocoa X86-64
« Reply #2 on: October 02, 2016, 06:02:24 pm »
Hi Jonas,

Good Afternoon.

Thank you for responding, after some googling and searching I realized I did not have the cross compiler for x-64 installed.

I could not find an easy way to accomplish this; so decided to use the fpclazup feature of lazup package.
When I installed Lazarus 1.7 and Free Pascal 3.1.1, I then installed the cross_x64 for trunk so as to get fpc 3.1.1 x64. I then started to experiment.

I noticed someone else having some odd behavior.

I tried one of my small apps that compile ok on windows and carbon and visually are nearly identical; however when compiling for cocoa x86-64, nearly all my additional visual controls are not showing on the form.

I then tried a simple application with some standard controls, most of these work ok, but some do not display when compiled.
When one of these components are used if running in terminal many errors are being displayed.

I am sure when I tested cocoa a while ago using 1.4.4 and fpc 2.6.4 most of the controls were working.

I have been watching the other thread with issues with BGRAbitmap, thinking it is the same/similar issue.

If you would like me test something; please let me know.

Thanks for your attention

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: OSX Cross Compiling for Cocoa X86-64
« Reply #3 on: October 23, 2016, 12:13:24 pm »
I use the IDE to compile 32-bit applications for the Carbon and Cocoa widget sets, and then use the command line to compile 64-bit OSX applications (for example, by MRIcroGL and Surf Ice projects, where you can get the code from Github or test the compiled versions from NITRC). For me, the command line looks like this:

lazbuild ./project1.lpr --cpu=x86_64 --ws=cocoa --compiler="/usr/local/lib/fpc/3.1.1/ppcx64"

I would recommend using the 1.7 SVN for Lazarus (I am at revision 53196), as Felipe has made a lot of improvements to Cocoa since the 1.6 release.

 

TinyPortal © 2005-2018