loading .so library C++
问题 I'm trying load library library.so, when i try if exist return true, but when I use dlopen return library doesn't exist. std::ifstream ifile("library.so"); if (ifile) { cout << "Exist!" << std::endl; } cout << "C++ dlopen demo\n\n"; // open the library cout << "Opening hello.so...\n"; void* handle = dlopen("library.so", RTLD_LAZY); if (!handle) { cerr << "Cannot open library: " << dlerror() << '\n'; return 1; } 回答1: dlopen is quite restricted in the paths it can search (to keep it short: the