Xcode
Start new software project for Mac OSX
New Project->Framework & Library | Cocoa Framework
Save name->teste
Other Sources ->right mouse ->Add->New File...
New File ->Mac OSX C and C++ ->C File
main.c
Change arch ->Release|i386
add code to main.c
int qvbmax(int a,int b)
{
if(a>b) return a;
else return b;
}
save
Build->Build Results->Build
...Build Succeeded
teste project directory
->build
--Release
--teste.framework
copy this package to /Library/Frameworks/
close xcode
vi testeok.c
#include <stdio.h>
int main(int argc,char *argv[])
{
int a,b,c;
a=90;
b=40;
c=qvbmax(a,b);
printf("\nc=%d\n",c);
}
save ...
gcc testeok.c -o testeok -framework teste
./testeok
c=90
job gook ok!