Hi everyone! I'm using cinterops to link a dynami...
# kotlin-native
l
Hi everyone! I'm using cinterops to link a dynamic library in a mingw binary executable. Everything is working fine, except that the .dll name that the executable asks is different from the one declared at the .def file. I don't know where this different name is coming from! This is from my gradle.build.kts:
Copy code
mingwX86("mingw"){
    compilations["main"].cinterops{
        val scape2 by creating {
            val cafmSrc = "C:/Software/SCAP E2/CAFM_src"
            val scapSrc = "C:/Software/SCAP E2/TO/ETME2"
            val modifiedSrc = "C:/Software/SCAP E2/Modified CAFM files"
            includeDirs.headerFilterOnly(cafmSrc, scapSrc, modifiedSrc)
            extraOpts.add("-verbose")

        }
    }
    binaries {
        executable()
    }
}
This is my scape2.def file:
Copy code
headers = scape2.h
headerFilter = scape2.h \ GEO_API_SCAPTO.h
linkerOpts.mingw = -LC:/Users/lscarmin/git/calculation-module4 -lscape2
I was expecting that the dll name to be scape2.dll. But when I run the executable, it asks for ETME2.dll! If I rename scape2.dll to ETME2.dll, the code works.
Well, it seems that the file name used is the one defined inside the dll. I have renamed the dll file, but the name used will be the original one. I didn't know that this info was kept inside the dll