dlopen() error image not found

后端 未结 2 1568
萌比男神i
萌比男神i 2021-01-18 04:29

I have software that first loads a .dylib lets call libFirst.dylib using the following command:

void* handle = dlopen(path.c_str(), RTLD_LAZY | RTLD_GLOBAL);         


        
相关标签:
2条回答
  • 2021-01-18 04:58

    use:

    install_name_tool -id @executable_path/../Frameworks/mylib.dylib mylib.dylib
    

    then check it with:

    otool -D mylib.dylib
    
    0 讨论(0)
  • 2021-01-18 05:13

    I ended up using -install_name to change the install name of all my libraries to @rpath/dylibName.dylib and then in Xcode I set the Runpath Search paths using @loader_path to find all my .dylibs that I was using.

    0 讨论(0)
提交回复
热议问题