اگه بخوام برای winavr کتابخونه درست کنم ( فایلهای با پسوند .a) چه کاری باید بکنم.
موفق باشید
موفق باشید
fred.c :
#include <stdio.h>
void fred(int arg)
{
printf(“fred: you passed %d\n”, arg);
}
bill.c:
#include <stdio.h>
void bill(char *arg)
{
printf(“bill: you passed %s\n”, arg);
}
$ avr-gcc -c bill.c fred.c
// This is lib.h. It declares the functions fred and bill for users void bill(char *); void fred(int);
$ ar crv libfoo.a bill.o fred.o
#include “lib.h”
int main()
{
bill(“Hello World”);
return 0;
}
$ avr-gcc -o program program.o libfoo.a or $ avr-gcc –o program program.o –L. –lfoo
OWN_LIB = -lfoo
EXTRALIBDIRS = ./mySubFolder/
EXTRALIBDIRS = .

دیدگاه