Roberto Leinardi
01/26/2025, 4:14 PMsymbol lookup error
at runtime? Like, try/catch or something similar these errors?
debugExecutable/app.kexe: symbol lookup error: debugExecutable/app.kexe: undefined symbol: gdk_cicp_params_get_type
ephemient
01/27/2025, 1:05 AMRoberto Leinardi
01/27/2025, 8:27 AMfun getTypeOrNull(symbolName: String): GType? {
// Passing null (or "") tells dlopen to search within the main program or any already-loaded shared libraries
val handle = dlopen(null, RTLD_LAZY) ?: return null
val symbolPtr = dlsym(handle, symbolName)
if (symbolPtr == null) {
dlclose(handle)
return null
}
val function = symbolPtr.reinterpret<CFunction<() -> GType>>()
val result: GType = function.invoke()
dlclose(handle)
return result
}