2012年12月7日 星期五

GCC option on Mac : -framework

之前在 FFmpeg tutorial on Mac OS X - tutorial01 中有提到,在 Mac 上編譯時會需要某些函式庫的東西,我們可以利用 -framework 這個 GCC 選項來加入我們所需要的函式庫,那時使用時,還不太了解它的作用。今天找到了它的使用說明,原來在 Apple Developer 的網站上有寫:


gcc(1) OS X Developer Tools Manual Page

       In addition to the options listed below, Apple's GCC also accepts and passes nearly all of the
       options defined by the linker ld and by the library tool libtool.  Common options include -framework,
       -dynamic, -bundle, -flat_namespace, and so forth.  See the ld and libtool man pages for further
       details.



ld(1) OS X Developer Tools Manual Page

-framework name[,suffix]
        This option tells the linker to search for `name.framework/name' the framework search path.
        If the optional suffix is specified the framework is first searched for the name with the
        suffix and then without (e.g. look for `name.framework/name_suffix' first, if not there try
        `name.framework/name').

看來 Apple Developer 要常去呀!

沒有留言:

張貼留言