If I place a folder called 'aes' in the same direc...
# kotlin-native
j
If I place a folder called 'aes' in the same directory as the file 'libaes.def' containing this:
Copy code
package = aes
headers = aes/aes.h
headerFilter = aes/aes.h
Why does my multiplatform solution upon build give me this exception:
Copy code
Exception in thread "main" java.lang.Error: /var/folders/60/htq84d4s4q55l9j0j1mh6d5w0000gn/T/tmp8457509487070388280.c:1:10: fatal error: 'aes/aes.h' file not found
If i enter the full absolute path to the files, everything works. But the documentation also states
Copy code
the files we reference need to be relative to the folder where the definition file is, or be available on the system path (in our case it would be /usr/include/curl).
Am I understanding something wrong?
d
You have to specify
includeDirs
in your build.gradle
For the cinterop configuration
j
@Dico Checking
d
It would be good practice to put the headers and binaries in your build directory
And add a task that downloads them
j
@Dico Not finding
includeDirs
for the multiplatform build.gradle This is the part i'm using to setup the cinterop:
Copy code
kotlin {
    targets {

        fromPreset(presets.androidNativeArm32, 'androidNative32')
        fromPreset(presets.androidNativeArm64, 'androidNative64')

        configure([androidNative32, androidNative64]) {
            compilations.main.cinterops {
                callback
                libaes
            }
            compilations.main.outputKinds 'dynamic'
        }
    }
}
m
Copy code
compilations.main.cinterops {
                    libaes {
                        includeDirs buildDir
                    }
                }
🖕🏻 1
j
@msink @Dico Thanks so much 🙂