Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
別の .dylib ファイルから .dylib ファイルを呼び出そうとしています。それらは同じフォルダーにあります。私はこれをします:
void* ハンドル = dlopen("./other.dylib", RTLD_LAZY);
しかし、ハンドルは NULL になり、dlerror() はそれが見つからないと言います。ただし、絶対パスを使用すると機能します。ドキュメントには、相対パスを使用できると書かれています。スペルとケースが正しいと確信しています。
なぜエラーになるのですか?
相対パスは、最初の dylib の場所ではなく、現在の作業ディレクトリに対する相対パスです。