compiling my project on Windows and I get this err...
# kotlin-native
l
compiling my project on Windows and I get this error with duplicate stdlibs definitions. What could this mean?
Copy code
Task :cinteropMylapsMingwX64 FAILED

Exception in thread "main" java.lang.Error: C:\Users\adams\.konan\dependencies\msys2-mingw-w64-x86_64-gcc-7.3.0-clang-llvm-lld-6.0.1\x86_64-w64-mingw32\include\sec_api/string_s.h:37:27: error: conflicting types for 'strcpy'
        at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:133)
        at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:959)
        at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:951)
        at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:74)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:229)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:38)
        at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:67)
        at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:18)

FAILURE: Build failed with an exception.
d
Can I see your def file?
l
It works on linux
Copy code
package mylaps
headers=MylapsSDK.h

---

bool availableappliance_is_compatible(const availableappliance_t* p)      {return MDP_BIT_ISSET(p->flags, aafIsCompatible);}

bool passingtrigger_is_resend(const passingtrigger_t* const p)					{return MDP_BIT_ISSET(p->flags, pbResend);}

#define MDP_BIT_ISSET(bitset, bit)				(((bitset) & (1<<(bit))) != 0)			//!< A macro that returns if a bit is set in a variable.
The same error without the c code
Its a c native code I dont own and can't change. There are some definition for extended strcpy_s etc for compatibility with old Visual Studio 2005
d
You could try
excludedFunctions= strcpy_s
to make cinterop ignore it.
l
Yes, seems to work. Thank you
d
No problem
m
Or add
headerFilter = MylapsSDK.h
to include only functions defined in MylapsSDK.h