fix uni link when mac service started, by use

applicationShouldOpenUntitledFile delegate
This commit is contained in:
rustdesk
2024-03-26 14:11:02 +08:00
parent e86d4657da
commit 9ad240951e
4 changed files with 46 additions and 11 deletions

27
main.cc Normal file
View File

@@ -0,0 +1,27 @@
#include <dlfcn.h>
#include <iostream>
int main()
{
void *handle = dlopen("../Frameworks/liblibrustdesk.dylib", RTLD_LAZY);
if (!handle)
{
std::cerr << "Cannot open library: " << dlerror() << '\n';
return 1;
}
// use dlsym to get a symbol from the library
typedef int (*some_func_t)();
some_func_t some_func = (some_func_t)dlsym(handle, "rustdesk_core_main");
const char *dlsym_error = dlerror();
if (dlsym_error)
{
std::cerr << "Cannot load symbol 'some_func': " << dlsym_error << '\n';
dlclose(handle);
return 1;
}
some_func();
dlclose(handle);
}