Recent

Author Topic: Problem with building Cocoa widgetset  (Read 10894 times)

Frantic

  • New Member
  • *
  • Posts: 18
Problem with building Cocoa widgetset
« on: November 16, 2010, 02:00:30 pm »
Hi!

I'm using Free Pascal Compiler version 2.4.2rc1 for i386 (built from svn trunk - r16350) and Lazarus 0.9.29 (build from svn trunk - r28268). Mac OSX Snow Leopard

Problem - I can't build Cocoa widgetset:

Code: [Select]
$ make lcl LCL_PLATFORM=cocoa
Compiling interfaces.pas
Compiling cocoaint.pas
cocoaint.pas(28,2) Warning: Illegal compiler switch "OBJECTIVEC1"
Fatal: Can't find unit CocoaAll used by CocoaInt
Fatal: Compilation aborted

Any ideas? Please, help!

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: Problem with building Cocoa widgetset
« Reply #1 on: November 16, 2010, 02:08:34 pm »
The ObjectiveC1 mode switch is only supported with FPC 2.5.1.

There's a mailing list dedicated to Objective Pascal and Cocoa:

http://lists.sonic.net/mailman/listinfo/mac-pascal

Thanks.

-Phil

Frantic

  • New Member
  • *
  • Posts: 18
Re: Problem with building Cocoa widgetset
« Reply #2 on: November 16, 2010, 02:22:25 pm »
Thanks, Phill!

But where can I get it? Cant find corresponding branch in http://svn.freepascal.org/svn/fpc/

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: Problem with building Cocoa widgetset
« Reply #3 on: November 16, 2010, 02:32:40 pm »
You can put something like this in a script and run it with sudo:

svn co http://svn.freepascal.org/svn/fpc/trunk /Developer/ObjectivePascal/fpc
cd /Developer/ObjectivePascal/fpc
sudo make distclean -j 3
make FPC=/usr/local/lib/fpc/2.4.0/ppc386 OPT="-ap" distclean all -j 2
export NEWFPCVERSION=`./compiler/ppc386 -iV`
sudo make FPC=`pwd`/compiler/ppc386 install
sudo make distclean -j 3

Thanks.

-Phil

Frantic

  • New Member
  • *
  • Posts: 18
Re: Problem with building Cocoa widgetset
« Reply #4 on: November 16, 2010, 02:47:13 pm »
Just did what you said, but still:

Code: [Select]
$ ppc386 -version
Free Pascal Compiler version  2.4.2rc1 2010/11/16

What could I do wrong?

Frantic

  • New Member
  • *
  • Posts: 18
Re: Problem with building Cocoa widgetset
« Reply #5 on: November 16, 2010, 03:00:44 pm »
Sorry, my fault! I did `which ppc386` and understood it was a symlink. I changed it to 2.5.1 version of compiler, but now another problem appeared:

Code: [Select]
/Developer/ObjectivePascal/lazarus/lcl/interfaces/cocoa/cocoaprivate.pp(55,14) Error: Replaced methods can only be reintroduced in Objective-C, add "reintroduce" (replaced method defined in LCLObjectExtension).

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: Problem with building Cocoa widgetset
« Reply #6 on: November 16, 2010, 03:04:53 pm »
Looks like that bug hasn't been fixed yet. See file attached to this bug report:

http://bugs.freepascal.org/view.php?id=17506

Note that the Cocoa widgetset is at best rudimentary. You won't be able to do anything useful with it.

On the MacPascal mailing list, they use Interface Builder to design forms and save to .nib files, then use these with ObjP code - i.e., non-LCL UI.

Thanks.

-Phil