make file problem

Applications, development tools, FPGA, C, WEB
Post Reply
adamS
Posts: 12
Joined: Mon Jul 09, 2018 11:25 am

make file problem

Post by adamS » Fri Mar 27, 2020 9:41 am

Hi everyone,

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,
Image

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*);
.c file:

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);
	}

};
make file:

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)

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 43 guests