Reference to 'X' is ambiguous

2019-01-18 02:22发布

After several changes to my project i suddenly get the build error:

Reference to 'kCGImageAlphaPremultipliedLast' is ambiguous

Reference is ambiguous and when when taking a look at the error it shows me that it is referenced 4 times

enter image description here

Can someone please tell me how this can happen and how can i figure out what is causing this? I am not importing anything from CoreGraphics explicitly and my Prefix file only imports ´Foundation.h´ and some self made macros. I am however importing several headers containing pure c code but they are all encapsulated in something like this:

#ifndef __MYCCODE_H
#define __MYCCODE_H
// imports here
// c code here
#endif

This happens in xcode 5 using LLVM 5.1

Edit: this seems to be a different problem with this project. after commenting this line of code i get another error:

Malformed or corrupted AST file: 'Unable to load module "/Users/xxx/Library/Developer/Xcode/DerivedData/ModuleCache/1NHZ5MC2OSMJV/CoreImage.pcm": module file out of date'

removing the module and adding it again did not help. deleting the derived data did also not help. this error also appears when going back to a working commit

8条回答
仙女界的扛把子
2楼-- · 2019-01-18 03:04

Well some solutions here are nice but use_frameworks! is exactly what I need now even thou it made this problem happening. But it looks like build does not like when I use frameworks and header is referenced twice like this

#import "TSMessage.h"
#import "TSMessage+CSExtension.h"

but problem gets away when it compiles like this

#import "TSMessage+CSExtension.h"
查看更多
Anthone
3楼-- · 2019-01-18 03:05

I have got this problem when I have imported a header file twice. After one of them is removed, the problem disappears.

查看更多
登录 后发表回答