I just ended porting my app from Delphi to Lazarus. Now it's time to compile it under Mac! But it's not an easy task. Lazarus for Mac doesn't have "Windows" unit, it doesn't like "{$R Form1.lrs}" directives and has troubles with "for s in MyStringList" enumeration...
Is there some information on how programming in Lazarus for Mac differs from programming in Lazarus for Windows? Tips and tricks? Blogs about Mac development using Lazarus?
Delphi sticks Windows into the uses statement of each form whether you need to call a Windows API function or not. Try taking out "Windows, Messages" and substituting "LclIntf, LMessages, LType". These are cross-platform units - LclIntf has a subset of the Win API functions (although a few are not implemented on all widgetsets). Now try compiling it on Windows. If it doesn't compile, you'll need to eliminate or isolate the stuff that's still Windows-specific.
Surely you mean "{$R Form1.lfm}"? Embedding an .lrs file as a resource wouldn't make sense. Are you compiling with at least FPC 2.4.0 on OS X?
I'm not familiar with the "for s in" syntax in Pascal. That must be something that has been introduced in an experimental version of FPC, but not yet in a stable version. If you want to retain support for that syntax, you'll need to build FPC 2.5.1 from SVN on your Mac and likely Lazarus too since no snapshot .dmg includes a version of FPC later than 2.4.0.
As long as you're going to build 2.5.1, you might investigate using Cocoa directly rather than Carbon via LCL. FPC 2.5.1 has a new {$MODESWITCH ObjectiveC1} directive which, as I've written elsewhere, allows you to "use and declare Objective C classes, categories and protocols in Pascal, thereby allowing you to work directly with Cocoa classes without the need for any "bridge" or intermediate layer" - i.e, a pretty cool extension to Pascal.
It depends on what you're doing. If you're like most Laz developers, meaning a hobbyist programmer or writing code for yourself, then the Carbon framework-based widgetset will do fine. But this is probably is not suitable for production code for a client or employer, who if they know better will want a Cocoa-based app.
In the unlikely event you're interested in actual Cocoa programming for the Mac, you might take a look at these blogs that somebody put together (not sure who):
http://delphitococoa.wordpress.com/concept-comparison/http://delphitococoa.wordpress.com/I also wrote a series of short articles covering some of the aspects of cross-platform programming that were of interest to me last winter:
http://web.me.com/macpgmr/Click on the Objective Pascal link.
Thanks.
-Phil