{"id":18824675,"url":"https://github.com/embarcadero/octoid","last_synced_at":"2026-01-20T16:30:21.348Z","repository":{"id":176528207,"uuid":"647481556","full_name":"Embarcadero/octoid","owner":"Embarcadero","description":"Octoid is a tool for translating Objective-C headers into Delphi code. It is intended as a replacement for SDKTransform which ships with Delphi.","archived":false,"fork":false,"pushed_at":"2024-05-10T00:18:09.000Z","size":835,"stargazers_count":34,"open_issues_count":10,"forks_count":9,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-12-30T04:41:26.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Embarcadero.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T22:00:54.000Z","updated_at":"2024-10-24T13:28:35.000Z","dependencies_parsed_at":"2024-05-10T01:28:51.270Z","dependency_job_id":null,"html_url":"https://github.com/Embarcadero/octoid","commit_stats":null,"previous_names":["embarcadero/octoid"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Embarcadero%2Foctoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Embarcadero%2Foctoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Embarcadero%2Foctoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Embarcadero%2Foctoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Embarcadero","download_url":"https://codeload.github.com/Embarcadero/octoid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239763665,"owners_count":19692802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T00:57:08.493Z","updated_at":"2026-01-20T16:30:21.301Z","avatar_url":"https://github.com/Embarcadero.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Octoid\r\n\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidMainLogoheader.png\" alt=\" \" height=\"240\" width=\"351\" /\u003e\u003c/p\u003e\r\n\r\n\r\n## Intro \r\n\r\nOctoid is a tool for translating Objective-C headers into Delphi code. It is intended as a replacement for SDKTransform which ships with Delphi.\r\n(Octoid is an acronym for Objective-C TranslatOr Into Delphi)\r\n\r\n\r\n\u003cp align=\"center\" style=\"margin: 50px 0 0 0;\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e \r\n\r\n## License\r\n\r\nPlease refer to the [license](https://github.com/Embarcadero/octoid/blob/main/LICENSE) regarding conditions of use for the code of Octoid.\r\n\r\n\r\n## Technical details\r\n\r\nIf you are interested in the details about how the Octoid code works, please refer to the [technical details readme](https://github.com/Embarcadero/octoid/blob/main/TechDetails.md).\r\n\r\n## Dependencies\r\n\r\nOctoid depends on Erik Van Bilsen's libraries:\r\n\r\n[Chet](https://github.com/neslib/Chet)\r\n[Neslib.Clang](https://github.com/neslib/Neslib.Clang)\r\n\r\nWhich Erik has granted permission to use in Octoid, and are presently included in the Octoid source\r\n\r\nNeslib.Clang is dependent on 64-bit CLang binaries that ship with [LLVM](https://llvm.org/)\r\n\r\nIn order to run Octoid, you will need to download and install LLVM. At time of writing, Octoid works with version 10.0.0 (there was no installer for Windows 64-bit for version 10.0.1).\r\n\r\n**Please ensure that you select the \"Add LLVM to the system path for all users\" option when installing**\r\n\r\n[This is a direct link to the version 10.0.0 installer](https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe)\r\n\r\n[This is a link to the releases page](https://releases.llvm.org/) which lists all releases\r\n\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e \r\n\r\n## Desktop App\r\n\r\nThe desktop app is a GUI (VCL) application for Windows. It allows you to select an SDK, select a framework and transform it into a Delphi unit.\r\n\r\nThe options page allows you customize how a banner (if required) is inserted into the unit.\r\n\r\n\u003cp align=\"center\" style=\"margin: 25px 0 25px 0;\"\u003e\u003cimg src=\"images/OctoidDesktop.png\" alt=\" \" height=\"586\" width=\"800\" /\u003e\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e \r\n\r\n## Commandline App\r\n\r\nThe commandline app is provided for automated transforms, or if you just prefer the command line. The usage is as follows:\r\n\r\n```\r\nOctoid [Options] [Extras]\r\n\r\nOptions:\r\n\r\n--help or --?  - show this help\r\n\r\n--sdkroot \u003csdkroot\u003e - root of the target SDK\r\n\r\n--clanginclude \u003cclanginclude\u003e - path to the Clang include files. May be omitted if a supported version of Clang is installed\r\n\r\n--platform \u003cplatform\u003e - the target platform (macOS or iOS)\r\n\r\n--unit \u003cframework\u003e - (optional) transform only the framework with the specified name (default is all frameworks in the SDK)\r\n\r\n--out \u003cout\u003e - (optional) directory where the output .pas files should be placed (default is current directory)\r\n\r\n--typemap \u003ctypemap\u003e - (optional) map of types containing equals separated values (can override existing mappings)\r\n\r\n--typeunitmap \u003ctypeunitmap\u003e - (optional) map of types to units containing equals separated values (can override existing mappings)\r\n\r\nExtras: additional options to be passed to libClang\r\n```\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e \r\n\r\n## Transforming 3rd party frameworks \r\n\r\nIt is possible to transform 3rd party frameworks, by copying the `.framework` folder into the `System\\Library\\Frameworks` folder of the nominated platform SDK.\r\nIt should be noted however, if the framework depends on any other 3rd party frameworks (including from the same vendor), they will need to be copied also, in order for a successful transform. Once a 3rd party framework has been copied, when the desktop app is restarted, or when a switch is made between SDKs, it will include the 3rd party framework in the frameworks list\r\n\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e \r\n\r\n## Dealing with fatal errors during translation\r\n\r\nIf a conversion fails to produce a translation using the desktop app, the output window will show and be at the bottom of the output so as to highlight the errors.\r\n\r\nCommonly, this will be due to missing header files, e.g. you may see an output like:\r\n\r\n```\r\nFATAL errors:\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/CoreVideo.framework/Headers/CVDisplayLink.h:26:10: error: 'OpenGL/OpenGL.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/CoreVideo.framework/Headers/CVOpenGLBuffer.h:20:10: error: 'OpenGL/OpenGL.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/CoreVideo.framework/Headers/CVOpenGLBuffer.h:21:10: error: 'OpenGL/gltypes.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/CoreVideo.framework/Headers/CVOpenGLTexture.h:22:10: error: 'OpenGL/OpenGL.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/CoreVideo.framework/Headers/CVOpenGLTexture.h:23:10: error: 'OpenGL/gltypes.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/CoreVideo.framework/Headers/CVOpenGLTextureCache.h:16:10: error: 'OpenGL/OpenGL.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/AppKit.framework/Headers/NSImageView.h:12:9: error: 'Symbols/NSSymbolEffect.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/AppKit.framework/Headers/NSOpenGL.h:10:9: error: 'OpenGL/CGLTypes.h' file not found\r\nC:\\Users\\dave\\Documents\\Embarcadero\\Studio\\SDKs\\MacOSX14.2.sdk\\System\\Library\\Frameworks/AppKit.framework/Headers/NSOpenGL.h:11:9: error: 'OpenGL/gltypes.h' file not found\r\n\r\nThe following appear to be frameworks not imported into the SDK, or are dependent frameworks that are missing:\r\nOpenGL, Symbols\r\n```\r\n\r\nOctoid makes \"intelligent guesses\" about the errors, and in this case has identified frameworks that appear to have not been imported into the target SDK (in this case macOS 14.2)\r\n\r\n[This link contains some instructions](https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AddSDKFrameworks) about how to add missing frameworks.\r\n\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e \r\n\r\n## Fixing issues with a translation\r\n\r\nOctoid is yet to produce \"perfect\" translations 100% of the time. The following are tips for resolving issues you might encounter.\r\n\r\n### References missing from existing imports\r\n\r\nAs at Jan 1st, 2024, there are some existing imports that are yet to be updated, so even though Octoid may include the relevant unit in the interface uses clause, there may be references that are missing from that unit, e.g.:\r\n\r\n`NSErrorDomain`:\r\n\r\nThis type is expected to be in the `Foundation` import for the respective OS e.g. `iOSapi.Foundation`. \r\n\r\n`NSErrorDomain` is just a synonym for `NSString`, so one way to fix this is to simply insert a declaration for it **in the unit that Octoid created for you**, i.e. put this in the type declarations:\r\n\r\n```delphi\r\n  NSErrorDomain = NSString;\r\n```\r\n\r\nOther missing references may not be as straightforward, e.g. if you use Octoid to import the `WebKit` framework for iOS, the compiler will report an error here:\r\n\r\n```delphi\r\n    function findInteraction: UIFindInteraction; cdecl;\r\n```\r\n\r\n`UIFindInteraction` is part of the `UIKit` framework, however it is yet to be included in `iOSapi.UIKit.pas`. You could solve this by:\r\n\r\nDoing an import of `UIKit`, and extracting the declarations for `UIFindInteraction` and any other types it depends on, \r\n\r\n**OR** \r\n\r\nIf the `findInteraction` method is not required by your code, you could just comment out the line, perhaps adding a comment indicating why the function was commented out. \r\n\r\n### Unit not included in the interface uses clause\r\n\r\nIf you use Octoid to import the `CoreHaptics` framework for iOS, you will notice an error in the declaration for `CHHapticEngine`:\r\n\r\n```delphi\r\n    function initWithAudioSession(audioSession: AVAudioSession; error: PPointer): Pointer; cdecl;\r\n```\r\n\r\nThe compiler reports:\r\n\r\n```\r\n[DCC Error] iOSapi.CoreHaptics.pas(219): E2003 Undeclared identifier: 'AVAudioSession'\r\n```\r\n\r\nThe `AVAudioSession` type is declared in the unit `iOSapi.AVFoundation`, so it is a simple matter of adding it to the interface uses clause of the unit that Octoid created, i.e. `iOSapi.CoreHaptics`\r\n\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003cimg src=\"logo/OctoidLogo40x40.png\" alt=\" \" height=\"40\" width=\"40\" /\u003e\r\n\u003c/p\u003e ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembarcadero%2Foctoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembarcadero%2Foctoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembarcadero%2Foctoid/lists"}