fbrausse / fxprog

Tools to program Cypress EZ-USB FX2/FX3 devices + low-level USB communication
MIT License
4 stars 4 forks source link

compile error! #1

Closed youxiaojie closed 4 years ago

youxiaojie commented 4 years ago

The following additional packages will be installed: libusb-1.0-0 The following packages will be upgraded: libusb-1.0-0 libusb-1.0-0-dev 2 upgraded, 0 newly installed, 0 to remove and 459 not upgraded. Need to get 136 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://mirrors.tuna.tsinghua.edu.cn/debian sid/main amd64 libusb-1.0-0-dev amd64 2:1.0.23-2 [77.6 kB] Get:2 http://mirrors.tuna.tsinghua.edu.cn/debian sid/main amd64 libusb-1.0-0 amd64 2:1.0.23-2 [58.0 kB] Fetched 136 kB in 0s (1,348 kB/s)
Reading changelogs... Done (Reading database ... 322469 files and directories currently installed.) Preparing to unpack .../libusb-1.0-0-dev_2%3a1.0.23-2_amd64.deb ... Unpacking libusb-1.0-0-dev:amd64 (2:1.0.23-2) over (2:1.0.23-1) ... Preparing to unpack .../libusb-1.0-0_2%3a1.0.23-2_amd64.deb ... Unpacking libusb-1.0-0:amd64 (2:1.0.23-2) over (2:1.0.23-1) ... Setting up libusb-1.0-0:amd64 (2:1.0.23-2) ... Setting up libusb-1.0-0-dev:amd64 (2:1.0.23-2) ... Processing triggers for libc-bin (2.29-6) ... allan@allan-home:/media/allan/c6293bbf-6fa1-49ca-9b01-24855a810e0e/jtag-usb-fx2lp/fx2lp/fxprog$ make cc -Wall -Wextra -pedantic -Wno-unused -std=c1x pkg-config --cflags libusb-1.0 -Wno-parentheses -O2 -c fxprog.c -o fxprog.o /bin/sh: 1: pkg-config: not found fxprog.c:9:10: fatal error: libusb.h: No such file or directory 9 | #include | ^~~~~~ compilation terminated. make: *** [Makefile:24: fxprog.o] Error 1

fbrausse commented 4 years ago

Hi, the command uses the tool pkg-config and can't seem to find it. I'm not sure, what system you are using, but pkg-config is pretty common on modern distributions. If it is not possible for you to install the tool, just try to replace the pkg-config --cflags libusb-1.0 part of the command line by -I/usr/include/libusb-1.0. Hope it works, please report back.

youxiaojie commented 4 years ago

I use debian sid. apt install libusb-1.0-0-dev to install header files.

root@allan-home:/home/allan# find / -name libusb*.h
/usr/include/libusb-1.0/libusb.h

so place "pkg-config --cflags libusb-1.0" with "-I/usr/include/libusb-1.0"? is there space" " after -I and a ending "/"? thanks!

youxiaojie commented 4 years ago

CFLAGS += -Wall -Wextra -pedantic -Wno-unused -std=c1x -I/usr/include/libusb-1.0 -Wno-parentheses LDLIBS += /usr/lib/x86_64-linux-gnu/libusb-1.0.so this is my modification. make success.

which package I should use to use your original Makefile pkg-config/unstable 0.29-6 amd64 manage compile and link flags for libraries pkgconf/unstable 1.6.3-5 amd64 manage compile and link flags for libraries thanks.

fbrausse commented 4 years ago

No space necessary. I used the first package in your list:

pkg-config/unstable 0.29-6 amd64

The 2nd seems to be a compatible replacement of the 1st one which I've never used.

fbrausse commented 4 years ago

make success.

Glad it works.