Sign in Join
Wiki copytemporary

Carbon interface FAQ: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11*(macOS only)*
22
33*(iOS only)*
44
55> **Warning:** The 32 bit Carbon interface is no longer under development since Apple removed all support for it and the ability to run 32 bit software in the release of macOS 10.15 Catalina in 2019. You should now use the 64 bit [[Cocoa Interface]].
66
77This is a list of frequently asked questions and problems about Carbon interface.
88
99## What's the state of Carbon interface?
1010
1111You can find out current status at [[Roadmap|Roadmap#Status of features on each widgetset]] and [[Roadmap|Roadmap#Status of components on each widgetset]]. You should also look at [[Carbon interface internals|Carbon interface internals#Compatibility issues]].
1212
1313## What's the state of Lazarus IDE under Carbon interface?
1414
1515The Lazarus IDE with a Carbon interface is as good or better than others. You can still help by reporting bugs at [[Carbon interface internals|Carbon interface internals#Carbon IDE Bugs]].
1616
1717## When I execute application compiled for Carbon interface, it can't be focused
1818
1919You have to execute Carbon application via Application Bundle. See [[Carbon Interface|Carbon Interface#Creating the Apple resource files]] how to create one.
2020
2121## I got a linking error when building Carbon application
2222
2323You have forgotten to pass options to the linker to use Carbon Framework. See [[Carbon Interface|Carbon Interface#Compiler Options]].
2424
2525## How can I rebuild LCL or Lazarus IDE for Carbon interface via terminal?
2626
2727You can use the following command in Lazarus directory:
2828
2929- for LCL:
3030
31-```
31+```text
3232make lcl LCL_PLATFORM=carbon
3333```
3434
3535- for Lazarus IDE:
3636
37-```
37+```text
3838make all LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL"
3939```
4040
4141under Leopard (10.5.x):
4242
43-```
43+```text
4444make all LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL -k'-dylib_file' \
4545 -k'/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib'"
4646```
4747
4848## I get error "make: -iVSPTPSOTO: Command not found" when I try to rebuild LCL or Lazarus IDE for Carbon interface via terminal.
4949
5050The reason of this error is, that Free Pascal Compiler executables are not found in search path. You must add their path to the terminal profile, which is located at your home directory:
5151
5252- for Bash terminal in ".profile" file (e.g. use command "open -e ~/.profile" in terminal). At the end of file add this line:
5353
54-```
54+```text
5555export PATH=$PATH:/usr/local/bin
5656```
5757
5858- for tcsh terminal in ".tcshrc" or ".cshrc" or ".login" file (e.g. use command "open -e ~/.cshrc" in terminal). At the end of file add this line:
5959
60-```
60+```text
6161append_path PATH /usr/local/bin
6262```
6363
6464, where "/usr/local/bin" is path to FPC executables. Save the result. It should work after terminal restart.
6565
6666## Unknown Stabs
6767
6868The Unknown Stabs warnings are caused by a bug in the Leopard 10.5+ Linker and most Lazarus users can simply ignore them and they don't cause any harm in the software execution.
6969
7070<http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg13235.html>
7171
7272That's because it also has to be partly fixed in the linker (which I didn't realise when I posted that message). The unknown stabs warnings (they're not errors afaik) are caused by stabs for local constants in functions/procedures (the linker interprets them as function stabs, because they have a very similar format and gcc does not generate stabs for constants).
7373
7474If you want, you can download a patched linker from <http://trappist.elis.ugent.be/~jmaebe/cctools/> (extract it to some directory, add a symbolic link to /usr/bin/as in the same directory, and point FPC to it using the -FD command line switch). That linker corresponds to the one shipped with Xcode 3.0 (+ the patches in that directory).
7575
7676But since end users most likely won't have that patched linker (and because stabs has been deprecated by Apple), you may want to switch to dwarf instead on Leopard 10.5+
7777
7878### Dwarf issues
7979
8080Compiling a project with -gw3 might crash the linker.
8181
8282-gw3 crashes the linker because of a bug in the linker. It can be worked around by setting the version number of the DWARF debug info to 2 even though version 3 is generated, but that's a hack.
8383
8484-gw2 does add debug information, just try debugging. On macOS, DWARF debug information however remains in the object files and is not added to the main binary by the linker (to speed up linking). You can compile with -Xg to collect all DWARF debug information for an application into a .dSYM bundle using dsymutil.
8585
8686Note that Apple's gdb crashes if you try to debug Lazarus after compiling it with -Xg, so that's not a good idea there.
8787
8888## Why my project doesn't work on earlier operating system versions?
8989
9090It's common situation when a project you've compiled works on your operating system version, but not on earlier ones. For example, you're developing using version 10.6. The project runs fine for you, but not for your user using version 10.5. If you look to the console output you'd probably see the error like (or similar):
9191
92-```
92+```text
9393/Applications/ProjApp.app/Contents/MacOS/projapp ; exit; dyld: unknown
9494required load command 0x80000022
9595Trace/BPT trap
9696logout
9797```
9898
9999It's caused, because you have compiled the project **without earlier OS version compatibility**. To add support for it, you need to specify the linker option (Project-\>Project Options-\>Linking-\>Options:
100100
101-```
101+```text
102102-macosx_version_min 10.5
103103```
104104
105105"Pass Options to the Linker (Delimiter is space)" must be checked.
106106
107107If you compile for 10.4 target, you should specify the 10.4 minimal version, and so on.
108108
109109Remember, if your installed Xcode doesn't contain the backward compatibility SDK, the project linking would probably fail. You can always obtain the required SDKs from the free Apple Xcode downloads.
110110
111111You can find more linkers options at [ld man page](http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/ld.1.html)
112112
113113### User friendly OS version requirement
114114
115115If your application requires a specific OS version and you don't want your app just to crash, you should provide the OS requirement version in bundle's Info.plist.
116116
117117### Which is the minimum macOS version required by LCL-Carbon?
118118
119119This information is documented here: [[LCL Internals|Minimum Toolkit Versions]]
120120
121121---
122122*From the Free Pascal wiki, page "Carbon interface FAQ", as it stood on 2021-08-04 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
123123Category: Carbon
124124Category: FAQs
125125Category: Historical
126126Category: Mac OS Classic
127127Category: macOS

Back to history