boundarydevices / imx_usb_loader

USB & UART loader for i.MX5/6/7/8 series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ubuntu 14.04 build error

yan2anfei opened this issue · comments

add option -std=c99,solve the problem

or std=gnu99

I noticed this when compiling on a raspberry pi the other day.

Hi,

Please specify your GCC version. I can't reproduce the issue with a standard Ubuntu 14.04 version:
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

Regards,
Gary

I have a pull request open with this change. If you want to try it, my branch is here: https://github.com/pmillerchip/imx_usb_loader/tree/ubuntu14-x64

@gibsson My gcc version is:
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

The master branch at the moment produces the following error:
cc -c imx_usb.c -o imx_usb.o -Wstrict-prototypes -Wno-trigraphs -pipe -ggdb pkg-config --cflags libusb-1.0 -DSYSCONFDIR='"/usr/etc"'
imx_usb.c: In function ‘do_autodetect_dev’:
imx_usb.c:533:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int retry = 0; retry < 10; retry++) {
^
imx_usb.c:533:3: note: use option -std=c99 or -std=gnu99 to compile your code
make: *** [imx_usb.o] Error 1

Fixed by: c8f4ead

Regards,
Gary