Altera_Forum
Honored Contributor
13 years agouclinux user application linking to lib
Hello all,
I am new to linux and just starting out and have encountred a small problem. I have got uClinux running on my DE2-115 and have writen a user application to print hello world. I put my hello.c file and makefile in the folder uClinux-dist/user/hello and that has worked it will print the hello message and can view it in the console. Now the problem is I want to include libusb and call some of its function from my hello.c program. I downloaded libusb-0.1.12.tar.gz and have extracted this and compiled it into uClinux-dist/lib/libusb-0.1.12 I am thinking i need to tell the compiler somehow to link the lib/libusb-0.1.12/ so it can find this include as its not in the regular location for the standard includes. How will i do this? hello.c#include <stdio.h># include "usbpp.h"
int main()
{
printf("Hello world");
} Makefile EXEC = hello
OBJS = hello.c
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
romfs:
$(ROMFSINST) /bin/$(EXEC)
clean:
-rm -f $(EXEC) *.elf *.gdb *.o I think i may need to edit this makefile to link the libusb library. The error i get is: usbpp.h: no such file or directory Anyhelp is appreciated!