• <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++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            @executable path, @load path and @rpath

            Posted on 2012-04-18 06:14 RTY 閱讀(1503) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): 編程常識(shí)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

            性做久久久久久久| 亚洲婷婷国产精品电影人久久| 久久午夜无码鲁丝片| 久久精品中文字幕无码绿巨人| 国产国产成人精品久久| 久久强奷乱码老熟女| 欧美大香线蕉线伊人久久| 国产精品久久久久久| 亚洲国产成人久久一区久久| 久久这里只有精品首页| 亚洲国产二区三区久久| 亚洲AV成人无码久久精品老人| 精品久久久久久无码中文野结衣| 99精品久久久久久久婷婷| 精品水蜜桃久久久久久久| 久久精品中文闷骚内射| 麻豆精品久久久久久久99蜜桃| 久久免费99精品国产自在现线 | 亚洲成av人片不卡无码久久| 久久精品国产久精国产一老狼| 国产精品无码久久久久| 国内精品伊人久久久久av一坑| 国产精品久久久久a影院| 久久精品视频91| 国产呻吟久久久久久久92| 久久久久一区二区三区| 久久99精品综合国产首页| 久久人人爽人人爽人人片AV不| 蜜桃麻豆WWW久久囤产精品| 无码乱码观看精品久久| 日本精品一区二区久久久| 欧美国产精品久久高清| 久久久精品视频免费观看| AAA级久久久精品无码区| 国产一区二区三区久久| 久久久青草青青亚洲国产免观| 久久99精品久久久久久久久久 | 国内精品久久久久久99蜜桃| 色狠狠久久AV五月综合| 久久超碰97人人做人人爱| 99国产精品久久久久久久成人热|