• <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 閱讀(1474) 評論(0)  編輯 收藏 引用 所屬分類: 編程常識Mac os 、Linux

            @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

            99热热久久这里只有精品68| 久久精品国产日本波多野结衣| 麻豆AV一区二区三区久久| 精品久久久久久成人AV| 国产精品久久99| 亚洲国产精品成人久久蜜臀 | 国产巨作麻豆欧美亚洲综合久久| 66精品综合久久久久久久| 国内精品伊人久久久影院| 国产一级持黄大片99久久| 久久五月精品中文字幕| 色综合久久久久综合体桃花网| A级毛片无码久久精品免费| 久久久无码精品亚洲日韩蜜臀浪潮| 久久精品国产99久久无毒不卡| 久久免费国产精品| 996久久国产精品线观看| 国产69精品久久久久APP下载 | 久久婷婷五月综合97色直播| 狠狠干狠狠久久| 天天爽天天狠久久久综合麻豆| 日韩十八禁一区二区久久 | 久久免费高清视频| 久久精品国产亚洲AV忘忧草18| 久久国产福利免费| 热99re久久国超精品首页| 久久久久久夜精品精品免费啦| 综合久久精品色| 久久午夜综合久久| 亚洲狠狠久久综合一区77777| 久久精品天天中文字幕人妻| 国产美女亚洲精品久久久综合| 亚洲国产成人精品久久久国产成人一区二区三区综 | 色妞色综合久久夜夜| 久久久久久久综合日本| 伊人久久大香线焦综合四虎| 国产V综合V亚洲欧美久久| 青青草原精品99久久精品66| 热re99久久精品国99热| 久久综合香蕉国产蜜臀AV| 无码国产69精品久久久久网站|