Sign in Join
Wiki copytemporary

Carbon interface FAQ: what changed

Revision 1 to 2. 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-`make lcl LCL_PLATFORM=carbon`
31+```
32+make lcl LCL_PLATFORM=carbon
33+```
3234
3335- for Lazarus IDE:
3436
35-`make all LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL"`
37+```
38+make all LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL"
39+```
3640
3741under Leopard (10.5.x):
3842
39-`make all LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL -k'-dylib_file' \`\
40-`    -k'/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib'"`
43+```
44+make all LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL -k'-dylib_file' \
45+ -k'/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib'"
46+```
4147
4248## I get error "make: -iVSPTPSOTO: Command not found" when I try to rebuild LCL or Lazarus IDE for Carbon interface via terminal.
4349
4450The 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:
4551
4652- for Bash terminal in ".profile" file (e.g. use command "open -e ~/.profile" in terminal). At the end of file add this line:
4753
48-`export PATH=$PATH:/usr/local/bin`
54+```
55+export PATH=$PATH:/usr/local/bin
56+```
4957
5058- 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:
5159
52-`append_path PATH /usr/local/bin`
60+```
61+append_path PATH /usr/local/bin
62+```
5363
5464, where "/usr/local/bin" is path to FPC executables. Save the result. It should work after terminal restart.
5565
5666## Unknown Stabs
5767
5868The 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.
5969
6070<http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg13235.html>
6171
6272That'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).
6373
6474If 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).
6575
6676But 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+
6777
6878### Dwarf issues
6979
7080Compiling a project with -gw3 might crash the linker.
7181
7282-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.
7383
7484-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.
7585
7686Note that Apple's gdb crashes if you try to debug Lazarus after compiling it with -Xg, so that's not a good idea there.
7787
7888## Why my project doesn't work on earlier operating system versions?
7989
8090It'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):
8191
82-`/Applications/ProjApp.app/Contents/MacOS/projapp ; exit; dyld: unknown`\
83-`required load command 0x80000022`\
84-`Trace/BPT trap`\
85-`logout`
92+```
93+/Applications/ProjApp.app/Contents/MacOS/projapp ; exit; dyld: unknown
94+required load command 0x80000022
95+Trace/BPT trap
96+logout
97+```
8698
8799It'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:
88100
89-`-macosx_version_min 10.5`
101+```
102+-macosx_version_min 10.5
103+```
90104
91105"Pass Options to the Linker (Delimiter is space)" must be checked.
92106
93107If you compile for 10.4 target, you should specify the 10.4 minimal version, and so on.
94108
95109Remember, 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.
96110
97111You can find more linkers options at [ld man page](http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/ld.1.html)
98112
99113### User friendly OS version requirement
100114
101115If 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.
102116
103117### Which is the minimum macOS version required by LCL-Carbon?
104118
105119This information is documented here: [[LCL Internals|Minimum Toolkit Versions]]
106120
107121---
108122*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).*
109123Category: Carbon
110124Category: FAQs
111125Category: Historical
112126Category: Mac OS Classic
113127Category: macOS

Back to history