After compiling the i found errors as below:
root:/Users/amir/linux$ make
cc randomfile.c -lusb -o randomfile
randomfile.c:16:17: error: usb.h: No such file or directory
randomfile.c: In function 'main':
randomfile.c:74: error: 'usb_busses' undeclared (first use in this function)
randomfile.c:74: error: (Each undeclared identifier is reported only once
randomfile.c:74: error: for each function it appears in.)
randomfile.c:74: error: dereferencing pointer to incomplete type
randomfile.c:75: error: dereferencing pointer to incomplete type
randomfile.c:75: error: dereferencing pointer to incomplete type
randomfile.c:76: error: dereferencing pointer to incomplete type
randomfile.c:77: error: dereferencing pointer to incomplete type
randomfile.c:84: warning: assignment makes pointer from integer without a cast
make: *** [randomfile] Error 1
I need to configure libusb to generate usb.h and other related header files.
I edit the Makefile and alter the parameter as below:
randomfile: randomfile.c
cc -I/opt/local/include -L/opt/local/lib \
randomfile.c -lusb -o randomfile
After that make it again:
cc -I/opt/local/include -L/opt/local/lib \
randomfile.c -lusb -o randomfile
randomfile.c: In function 'main':
randomfile.c:99: warning: pointer targets in passing argument 3 of 'usb_bulk_read' differ in signedness
Phew, ignore the error. Basically its no error, but warning. After successcully compile the .c file, one binary file generated called randomfile
Let test the tools:
./randomfile 1000 > random.hex
one file generated random.hex with these:
4968550d1a5de37609488a881d8252
104671ad00e778778e652943d2bbb6
ecde36645bfd64d4f9e9fdd86a2ebe
9569cff8b3ab2176763d72ae3b5a40
c7098540611067253ea2cef2ef0475
de635f5af7176f49cabe700ef516a2
990ced11a45f316e89c1c5d76210a0
1ff02581a88b769af61f453d8055dd
9ee741a231b796a3455d38b5390894
8a56a6e2fbe33e981905ef071f5641
d6a1b398e8b90ae4907d7bca30e1a3
ae691d968c1acaac4997c124bf24e3
b19f6f91b71003bbe9ff3316300bb7
rgds
Amir Haris Ahmad
No comments:
Post a Comment