Подтвердить что ты не робот

Связь с каркасами Apple с gcc

Я создал некоторые функции-оболочки, которые инкапсулируют работу с CoreAudio, и цель состоит в создании библиотеки C, которую я могу использовать с некоторыми инструментами С++ с командной строкой. Пока все работает хорошо. Я взял образец проекта, изменил его, и он строит и запускает в XCode. Я хотел бы вообще пропустить XCode и создать библиотеку с gcc и Makefile.

Как я могу связать себя с Apple Framework? Являются ли Frameworks только разделяемыми библиотеками, которые я мог бы включить в опции -l и -L в gcc?

4b9b3361

Ответ 1

Вот пример:

gcc -framework CoreServices -o test test.c

Из man-страницы Apple gcc (i686-apple-darwin10-gcc-4.2.1):

   In addition to the options listed below, Apple 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 man:

 -framework name[,suffix]
             This option tells the linker to search for `name.frame-
             work/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.frame-
             work/name_suffix' first, if not there try `name.frame-
             work/name').