Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create pas files #24

Open
felixtool opened this issue Jan 11, 2024 · 3 comments
Open

Cannot create pas files #24

felixtool opened this issue Jan 11, 2024 · 3 comments
Assignees

Comments

@felixtool
Copy link

We would like to translate Objective-C headers into Delphi code. To achieve this task, we plan to use the Octoid tool developed by you. The environment is as follows: Operating System: Windows 11, RadStudio 11.3, LLVM 10 64bit. After installing LLVM 10.0 and compiling the UI App under RadStudio 11.3, we followed the steps exactly as explained in the “Intro Into Octoid” video. First we tried the BackgroundTasks framework, but it has the same issue as f.e. the Foundation framework.

The “Output” is:

Using arguments:
-isystemC:\Users\mijomijo\Documents\Embarcadero\Studio\SDKs\iPhoneOS16.4.sdk\usr\include
-isystemC:\Program Files\LLVM\lib\clang\10.0.0\include
-FC:\Users\mijomijo\Documents\Embarcadero\Studio\SDKs\iPhoneOS16.4.sdk\System\Library\Frameworks
-FC:\Users\mijomijo\Documents\Embarcadero\Studio\SDKs\iPhoneOS16.4sdk\System\Library\Frameworks
-x
objective-c
-ferror-limit=50
-target
arm-apple-darwin10
Parsing header files...
\System\Library\Frameworks/Foundation.framework/Headers/NSString.h:378:81: error: function does not return string type
\System\Library\Frameworks/Foundation.framework/Headers/NSString.h:379:52: error: function does not return NSString
\System\Library\Frameworks/Foundation.framework/Headers/NSString.h:394:53: error: function does not return NSString
\System\Library\Frameworks/Foundation.framework/Headers/NSString.h:396:83: error: function does not return string type
\System\Library\Frameworks/Foundation.framework/Headers/NSString.h:402:114: error: function does not return string type
\System\Library\Frameworks/Foundation.framework/Headers/NSString.h:403:97: error: function does not return string type
\System\Library\Frameworks/Foundation.framework/Headers/NSBundle.h:93:143: error: function does not return NSString
\System\Library\Frameworks/Foundation.framework/Headers/NSURLSession.h:531:186: error: expected ')'
Parsed header files with 8 error(s)
Analyzing data types...

As You can see, we run into header file parse errors, which are based on NS_FORMAT_ARGUMENT macro.

If we are using a higher version of the libclang.dll (tested from version 14.0), the header parsing is successful, but we get EListError: Duplicates not allowed.

All the tested units are from the standard Apple iOS SDK. We would appreciate your assistance in resolving this issue.

In advance, thank you for the help!

@kpheidrich
Copy link

Regarding the error "Duplicates not allowed" my ticket #25 may be just that: a duplicate ;-)
You could check, if it helps to get your header file translated.

@DelphiWorlds DelphiWorlds self-assigned this Apr 26, 2024
@DelphiWorlds
Copy link
Collaborator

DelphiWorlds commented Apr 26, 2024

I'm not seeing these errors with the current Octoid code when performing an import for the Foundation framework for iOS, using v14.0.0 of libclang.dll. There are however known issues with importing this framework - if there are types not available in iOSapi.Foundation.pas (that ships with Delphi) that you wish to import, you may need to just extract them from the erroneous import and use them in your code.

If you're still unable to perform an import, I'll do one (from which you can extract the required types) and add it to this repo

I've filed this issue related to the erroneous import problem

@DelphiWorlds
Copy link
Collaborator

I've pushed a fix for the duplicates issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants