I have a declaration like this:

extern "C++" CHARSET_INFO compiled_charsets[];

which compiled fine so far, but now with the update to XCode 5.1 I get an error for that:

.../my_sys.h:277:27: Definition of variable with array type needs an explicit size or an initializer

It's certainly just a newly enabled LLVM check, but I'm curious to know how you would cope with such an error in general, especially if that is in a 3rd party header file you can't change. But also if you could change it what would it look like? I mean, how can I initialize an external array? It's defined somewhere else. It makes no sense to initialize the external reference.

有帮助吗?

解决方案

Found the solution myself. Not sure why is LLVM having trouble with this but removing the "C++" part makes it compile that code again:

extern CHARSET_INFO compiled_charsets[];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top