macmade/Objective-CPP

Compiler issue with Xcode 15.3 & C++20

Closed this issue · 27 comments

Hi,
I'm trying to use your library in our project using a c++20 compiler (the IDE is Xcode) and we are having a compilation error(Please see attachments).

Could you please let me know how we can fix it effectively without braking your code.

Untitled

image

Thank you,
Stay safe

I just tried to compile and test the library with C++20 without issues.

Based on the compiler error, it looks like you're not using it properly.
Can you show the code which calls DictionaryFromMap?

(it would be great if you could avoid posting code screenshots, by the way)

Just post the code calling into DictionaryFromMap here...

I don't think these are the lines causing your issue.
I can compile this code with Xcode 15.3 and C++ 20 without errors.

There's also a unit test for that case:

m = ObjectiveCPP::MapFromDictionary< std::string, NSString >( d, @selector( cppString ) );

Based on the compiler error you showed, you're calling MapFromDictionary with 3 arguments.
Please show the relevant code.

Can you show me the complete compiler error from Xcode's build log?

Xcode

I need the complete compiler error.
You can expand the message to get more details:

Error

Go to the build log, click on the failed build action, expand the message, as shown in the screenshot.
It will give the information I need.

I just tested with iOS, no problem with C++20.
Which version of Objective-CPP are you using?

Please format code when you post…

Your compiler output is odd.
I guess you're not using the provided library but instead compiling the sources directly into your project.

There's no reason for your changes. The whole library builds fine with C++20 as is.

It means your Xcode project is not set-up properly.

Latest commit from main, that is 05e2775

Closing...
Feel free to reopen if you still have issues.