• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 319, comments - 22, trackbacks - 0, articles - 11
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            @executable path, @load path and @rpath

            Posted on 2012-04-18 06:14 RTY 閱讀(1503) 評論(0)  編輯 收藏 引用 所屬分類: 編程常識Mac osLinux

            @executable path, @load path and @rpath

            2010年11月6日 by Wincent Colaiuta

            Note: this article is actually about the @executable_path, @load_path and @rpath install paths used by the linker on Mac OS X; wiki titles can't include underscores, however, because they are ambiguous with spaces.

            Absolute paths

            Useful for frameworks installed in shared locations. Example:

            • Install path: /Library/Frameworks/Foo.framework/Versions/A/Foo

            @executable_path

            Useful for frameworks embedded inside applications, because it allows you to specify the location of the framework relative to the application's executable:

            • Install path: @executable_path/../Frameworks/Foo.framework/Versions/A/Foo
            • Application location: /Applications/Foo.app
            • Executable path: /Applications/Foo.app/Contents/MacOS
            • Framework location: /Applications/Foo.app/Contents/Frameworks/Foo.framework
            • Linker puts all this together to figure out that the framework binary can be found at: /Applications/Foo.app/Contents/MacOS/../Frameworks/Foo.framework/Versions/A/Foo

            @loader_path

            Available from Mac OS X 10.4 Tiger onwards; useful for frameworks embedded inside plug-ins, because it allows you to specify the location of the framework relative to the plug-in's code (remember, plug-ins may not actually know where they are going to be installed, relative to the application, so knowing @executable_path doesn't help us in this case):

            • Install path: @loader_path/../Frameworks/Foo.framework/Versions/A/Foo
            • Application location: /Applications/Foo.app
            • Plug-in location: /Library/Application Support/Foo/Plug-Ins/Bar.bundle
            • Executable path: /Applications/Foo.app/Contents/MacOS
            • Loader path: /Library/Application Support/Foo/Plug-Ins/Bar.bundle/Contents/MacOS
            • Framework location: /Library/Application Support/Foo/Plug-Ins/Bar.bundle/Contents/Frameworks/Foo.framework
            • Linker puts all this together to figure out that the framework binary can be found at: /Library/Application Support/Foo/Plug-Ins/Bar.bundle/Contents/MacOS/../Frameworks/Foo.framework/Versions/A/Foo

            Note that if the "loader" is an application rather than a plug-in, the @loader_path ends up being equivalent to @executable_path.

            @rpath

            New in Mac OS X 10.5 Leopard is @rpath. Key points:

            • @rpath instructs the dynamic linker to search a list of paths in order to locate the framework
            • critically, this list is embedded in the loading application
            • this means that a single framework with @rpath/Foo.framework/Versions/A/Foo can be made to work in a number of different ways; that is, you are effectively no longer limited by the choice of specifying your "install path" using either @executable_path or @loader_path
            • the down side: you now have to pass additional linker flags when building the host application (eg. -rpath @executable_path/../Frameworks or /Library/Frameworks; note that specifying both will cause the dynamic linker to try looking in both locations)

            Sources

            精品无码久久久久国产| 要久久爱在线免费观看| 久久综合给久久狠狠97色| 无码日韩人妻精品久久蜜桃| 激情伊人五月天久久综合| 91精品国产高清久久久久久国产嫩草 | 日韩欧美亚洲综合久久| 久久久久久国产a免费观看黄色大片| 久久天天躁狠狠躁夜夜avapp | 伊人久久综合成人网| 一级做a爱片久久毛片| 伊人久久大香线焦AV综合影院| 欧美精品一本久久男人的天堂| 2021国内精品久久久久久影院| 国产精品久久久久久| 国产精品久久久久a影院| 91精品国产91热久久久久福利| 香蕉久久夜色精品升级完成 | 久久精品aⅴ无码中文字字幕不卡| 91精品国产综合久久精品| 人妻无码精品久久亚瑟影视 | 日韩精品无码久久久久久| 人妻无码久久精品| 久久国产精品无码网站| 国产精品久久午夜夜伦鲁鲁| 中文字幕热久久久久久久| 久久影视综合亚洲| 久久无码AV中文出轨人妻| 国产成人精品久久亚洲高清不卡 | 久久久精品国产免大香伊 | 亚洲国产成人乱码精品女人久久久不卡 | 久久精品中文字幕大胸| 久久精品亚洲精品国产欧美| 一本久久a久久精品综合夜夜| 久久青青草原亚洲av无码app| 伊人久久综合精品无码AV专区 | 久久久久香蕉视频| 久久艹国产| 香港aa三级久久三级老师2021国产三级精品三级在 | 精品无码久久久久久尤物| 久久精品国产亚洲αv忘忧草|