vdudouyt / stm8flash

program your stm8 devices with SWIM/stlinkv(1,2)
GNU General Public License v2.0
402 stars 182 forks source link

not compiled in ubuntu 18.04 #100

Open GavukaAlexandr opened 6 years ago

GavukaAlexandr commented 6 years ago

sudo apt-get install pkg-config sudo apt-get install libusb-1.0-0-dev You need to change the path to the libusb in the stm8flash/pgm.h file on #include </usr/include/libusb-1.0/libusb.h>

spth commented 6 years ago

I guess we'd need a configure script or a full autotools setup to handle varying libusb locations portably.

Philipp

mrx23dot commented 3 years ago

Same problem on debian too, it's located at /usr/include/libusb-1.0/libusb.h

stefaandesmet2003 commented 2 years ago

same file location on ubuntu 20.04, but stm8flash compiles OK.

agentgoblin commented 2 years ago

Debian 11 and Ubuntu 20.04 reporting. Package libusb-1.0-0-dev places the libusb.h in /usr/include/libusb-1.0/libusb.h in both distros. stm8flash compiled successfully after installing pkg-config.

$ make
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o stlink.o stlink.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o stlinkv2.o stlinkv2.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o espstlink.o espstlink.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o main.o main.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o byte_utils.o byte_utils.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o ihex.o ihex.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o srec.o srec.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o stm8.o stm8.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`    -c -o libespstlink.o libespstlink.c
cc -g -O0 -DDEBUG=0 --std=gnu99 --pedantic -Wall `pkg-config --cflags libusb-1.0`  stlink.o stlinkv2.o espstlink.o main.o byte_utils.o ihex.o srec.o stm8.o libespstlink.o `pkg-config --libs libusb-1.0` -o stm8flash
$ ./stm8flash -V
20170616-1.1
agentgoblin commented 2 years ago

I guess we'd need a configure script or a full autotools setup to handle varying libusb locations portably.

pkg-config does it.

spth commented 2 years ago

For me (Debian GNJ/Linux testing) it always worked fine via the pkg-config in the Makefile.