I have an exception running cinterop on an Objecti...
# kotlin-native
j
I have an exception running cinterop on an Objective-C library. It is an NSEnum and I tried to specifically import the header file in the def file. What does the exception mean and how can I solve it?
Copy code
> Task :cinteropRocksdbMacos
Exception in thread "main" java.lang.IllegalArgumentException: 'BlockBasedTableIndexType' from the file package was not reserved for declaration
	at org.jetbrains.kotlin.native.interop.gen.KotlinFile.reference(KotlinCodeModel.kt:263)
	at org.jetbrains.kotlin.native.interop.gen.KotlinClassifierType.render(KotlinCodeModel.kt:115)
	at org.jetbrains.kotlin.native.interop.gen.StubIrTextEmitter.renderStubType(StubIrTextEmitter.kt:467)
	at org.jetbrains.kotlin.native.interop.gen.StubIrTextEmitter.access$renderStubType(StubIrTextEmitter.kt:18)
	at org.jetbrains.kotlin.native.interop.gen.StubIrTextEmitter$printer$1.visitProperty(StubIrTextEmitter.kt:256)
For reference I used the following def file:
Copy code
language = Objective-C
headers = ObjectiveRocks.h
I also tried:
Copy code
language = Objective-C
headers = ObjectiveRocks.h  RocksDBBlockBasedTableOptions.h
I try to include this code: https://github.com/iabudiab/ObjectiveRocks/tree/develop/Code
a
It looks like the
ObjectiveRocks.h
already has the
#import "RocksDBBlockBasedTableOptions.h"
line. What do you want to achieve?
j
It does not work with or without that header. I want it to run the cinterop task without crashing with above message. But I don't understand what
'BlockBasedTableIndexType' from the file package was not reserved for declaration
tries to say. It is defined in
RocksDBBlockBasedTableOptions.h
a
Thank you for the details. We had successfully reproduced this behavior, and now we’re investigating its causes. Please wait for updates.
j
Ah thanks for checking it out! 😄
s
j
Thanks!