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

build error: Ns_error_domain attribute only valid on enum/struct/union/class #4164

Closed
yijiasu opened this issue Sep 29, 2016 · 15 comments · Fixed by #4168
Closed

build error: Ns_error_domain attribute only valid on enum/struct/union/class #4164

yijiasu opened this issue Sep 29, 2016 · 15 comments · Fixed by #4168
Assignees
Labels

Comments

@yijiasu
Copy link

yijiasu commented Sep 29, 2016

Realm version: 2.0.0

Xcode version: 8.0

iOS/OSX version: Deploy Target at iOS 8

I installed realm with Static Framework to my project. When I try to build the entire project, i've got these compile-time errors:

RLMConstants.h:100:1: Ns_error_domain attribute only valid on enum/struct/union/class RLMSyncUtil.h:30:1: Ns_error_domain attribute only valid on enum/struct/union/class
I tried using Cocoapods, but these error still occurs.

Is there anything I mis-configured for the Xcode?

Thanks!

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

Can you please share the exact version of Xcode that you're using? You can find it in the About Xcode window (Xcode -> About Xcode). Mine is Version 8.0 (8A218a), for instance.

@yijiasu
Copy link
Author

yijiasu commented Sep 30, 2016

Version 8.0 (8A218a). The same as yours :)

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

Hmm. I think you'll need to share more information about what you're doing when you see the error.

Do you see the error if you do the following:

  1. git clone --recursive https://github.com/realm/realm-cocoa.git
  2. sh build.sh ios-static

Or does it only appear when compiling your project when it brings in a Realm header file?

@ch4ot1c
Copy link

ch4ot1c commented Sep 30, 2016

Issue is present for me as well, with a Cocoapods installation, on current Master branch (2.0.1), on latest XCode 8. I have the same error, line 100 of RLMConstants.h and line 30 of RLMSyncUtil.h. Realm for ObjC

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

Are you seeing the error when building Realm, or when building something that uses Realm?

@ch4ot1c
Copy link

ch4ot1c commented Sep 30, 2016

Building an .xcworkspace with Realm as a Cocoapods dependency. 'Building appname: Realm' appears and seems to happen successfully in the XCode status bar ; the compiler error shows at the very end of the build process

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

Can you please share a copy of the full build log that shows the failure? It's possible there are particular compiler flags or similar that are triggering this issue as we're not able to reproduce this in any of our demo projects. If you'd rather not share the build log publicly, please feel free to email it to help@realm.io.

@ch4ot1c
Copy link

ch4ot1c commented Sep 30, 2016

Sent

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

Thanks. Which version of Realm were you previously using that was building successfully?

@ch4ot1c
Copy link

ch4ot1c commented Sep 30, 2016

Never seen the error before 2.0.0, appears in both 2.0.0 and 2.0.1

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

Were you on v1.1.0 prior to attempting to update to v2.0.0?

@ch4ot1c
Copy link

ch4ot1c commented Sep 30, 2016

Yes, but we are still amidst the Swift3 conversion process and haven't had a completed build on XCode8 (due to some of our forked dependencies having diverged significantly from their latest Swift3 impl), so I'm not certain and don't want to give you any false info =p. bacfaa4 is the last RLM commit ref in Podfile on our pre-Swift3 branch.

@ch4ot1c
Copy link

ch4ot1c commented Sep 30, 2016

That being said, the error only started appearing today upon moving to 2.0.0, and moments later 2.0.1

@bdash
Copy link
Contributor

bdash commented Sep 30, 2016

I've managed to reproduce this. It appears to be specific to building Objective-C++ files with the C++98 language setting, as CoreFoundation defines CF_ENUM differently for older C++ versions.

@ch4ot1c
Copy link

ch4ot1c commented Oct 1, 2016

Fantastic - For now I'll adjust that in my project. Thanks a million, I'll keep an eye on this Issue as well

@bdash bdash removed the S:P1 Backlog label Oct 1, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants