I creates my .h file in /opt/quantaser/include and the corresponding .c file in /opt/quantaser/lib,
then I build the .so file from .c file and .h file and modify the redpitaya makefile to include the new path,
but when I run make command,
I always get "undefined reference to..." message,
I tried replace .so with .a file but got the same result,
Does anyone know how to solve this problem?
Many thanks!
Adam.S
.h file:
Code: Select all
#include <stdio.h>
void test_print(int, char*);
Code: Select all
#include "tt.h"
#include <stdio.h>
void test_print(int num, char* a)
{
for(int i=0;i<num;i++)
{
printf("%s\n",a);
}
};
Code: Select all
CFLAGS = -g -std=gnu99 -Wall -Werror
CFLAGS += -I/opt/redpitaya/include -I/opt/quantaser/include
LDFLAGS = -L/opt/redpitaya/lib -L/opt/quantaser/lib
LDLIBS = -lm -lpthread -lrp
SRCS=$(wildcard *.c)
OBJS=$(SRCS:.c=)
all: $(OBJS)
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
clean:
$(RM) *.o
$(RM) $(OBJS)