Reference to [symbol] is ambiguous, but it's the same symbol...

I've got a Project with a bunch of frameworks, each of which has a static library version of itself (for compiling command-line tools that also use the code).

Compiling the frameworks goes fine. Compiling one of the static libraries (A Mime-parsing framework) is giving me the rather odd message that a bunch of symbols are ambiguous, but the ambiguity resolves to the same symbol in the error-message...

~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:57:18: error: reference to 'E3_SMIME_ENVELOPED_DATA' is ambiguous
   57 |             case E3_SMIME_ENVELOPED_DATA:
      |                  ^
In file included from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:9:
~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:17:2: note: candidate found by name lookup is 'E3_SMIME_ENVELOPED_DATA'
   17 |         E3_SMIME_ENVELOPED_DATA,        // Enveloped data
      |         ^
In module 'E3Mime' imported from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:8:
~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:17:2: note: candidate found by name lookup is 'E3_SMIME_ENVELOPED_DATA'
   17 |         E3_SMIME_ENVELOPED_DATA,        // Enveloped data
      |         ^

... and again ...

~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:62:18: error: reference to 'E3_SMIME_SIGNED_DATA' is ambiguous
   62 |             case E3_SMIME_SIGNED_DATA:
      |                  ^
In file included from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.m:9:
~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:18:2: note: candidate found by name lookup is 'E3_SMIME_SIGNED_DATA'
   18 |         E3_SMIME_SIGNED_DATA,           // Signed data
      |         ^
In module 'E3Mime' imported from ~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:8:
~/src/E3Mail/Frameworks/E3Mime/E3Mime/Message/MIME/E3AppPkcs7Part.h:18:2: note: candidate found by name lookup is 'E3_SMIME_SIGNED_DATA'
   18 |         E3_SMIME_SIGNED_DATA,           // Signed data
      |         ^

... and again, etc ...

.

No file inside the module (neither .m or .h) includes the module-header, the definition of the offending symbols looks like:

//
//  E3AppPkcs7Part.h
//  E3Mime
//

#import <E3Mime/E3CryptoContext.h>
#import <E3Mime/E3MimePart.h>
#import <E3Mime/E3MimeMultipartEncrypted.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum
    {
	E3_SMIME_COMPRESSED_DATA,       // Compressed data
	E3_SMIME_ENVELOPED_DATA,        // Enveloped data
	E3_SMIME_SIGNED_DATA,           // Signed data
	E3_SMIME_CERTS_ONLY,            // Only certificate data
	E3_SMIME_UNKNOWN,               // Que ?
    } E3SMimeType;
...

And when I click on the error adornment in the editor pane, the errors disappear. It still won't build the project, though. I just get the same errors the next time I press CMD-B.

Can't upload a short screen-capture of that, so I put it the movie at http://0x0000ff.co.uk/mov/phantom-errors.mov.

[Addendum]

I have worked around it for the time being, as below, but this is fugly...


# if XCODE_WORKAROUND_ENUMS
#  define E3_SMIME_COMPRESSED_DATA          (0)
#  define E3_SMIME_ENVELOPED_DATA           (1)
#  define E3_SMIME_SIGNED_DATA              (2)
#  define E3_SMIME_CERTS_ONLY               (3)
#  define E3_SMIME_UNKNOWN                  (4)
#  define E3SMimeType                       int
# else
    typedef enum
        {
        E3_SMIME_COMPRESSED_DATA,       // Compressed data
        E3_SMIME_ENVELOPED_DATA,        // Enveloped data
        E3_SMIME_SIGNED_DATA,           // Signed data
        E3_SMIME_CERTS_ONLY,            // Only certificate data
        E3_SMIME_UNKNOWN,               // Que ?
        } E3SMimeType;
# endif
Reference to [symbol] is ambiguous, but it's the same symbol...
 
 
Q