Dear all,
i try to compile a OpenWRT program to control the FT232RL's GPIO by using the LibFTDI.
helloworld src is from libFTDI Sample.
Process:
1.it works by using cc compiler :
[root@PC-LINUX src]$ make
cc -c helloworld.c
cc helloworld.o -lpthread -lftdi -o helloworld
[root@PC-LINUX src]$ ./helloworld
unable to open ftdi device: -3 (device not found)
2. But Fail by Cross complie by:
[root@PC-LINUX trunk]# make package/helloworld/compile V=99
......
helloworld.c:1: note: someone does not honour COPTS correctly, passed 0 times
helloworld.c:9:18: error: ftdi.h: No such file or directory
helloworld.c: In function 'main':
helloworld.c:16: error: storage size of 'ftdic' isn't known
helloworld.c:20: error: 'EXIT_FAILURE' undeclared (first use in this function)
helloworld.c:20: error: (Each undeclared identifier is reported only once
helloworld.c:20: error: for each function it appears in.)
helloworld.c:30: error: 'TYPE_R' undeclared (first use in this function)
helloworld.c:45: error: 'EXIT_SUCCESS' undeclared (first use in this function)
--------------------
Makefile
# Build the helloworld executable when the user executes make
## Linking stage
helloworld: helloworld.o
$(CC) $(LDFLAGS) helloworld.o -lpthread -lftdi -o helloworld
# Compiling stage
helloworld.o: helloworld.c
$(CC) $(CFLAGS) -c helloworld.c
# Remove object and executable files when the user executes make clean
clean:
rm *.o helloworld
could you please advice ,thanks for your kind help.
aico
(Last edited by kwongwo on 27 Jul 2012, 17:00)