Sysinternals / ProcDump-for-Linux

A Linux version of the ProcDump Sysinternals tool
MIT License
2.95k stars 306 forks source link

Compilation fails on Kubuntu 14.04.5 LTS #18

Closed yetipenguin closed 6 years ago

yetipenguin commented 6 years ago

Expected behavior

Program is compiled when running make

Actual behavior

Compilation fails: LANG=C_ALL make rm -rf obj rm -rf bin rm -rf release gcc -c -g -o obj/CoreDumpWriter.o src/CoreDumpWriter.c -I ./include -pthread src/CoreDumpWriter.c: In function 'WriteCoreDumpInternal': src/CoreDumpWriter.c:186:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = 0; j < i; j++){ ^ src/CoreDumpWriter.c:186:9: note: use option -std=c99 or -std=gnu99 to compile your code make: *** [obj/CoreDumpWriter.o] Error 1

Steps to reproduce the behavior

  1. git clone https://github.com/Microsoft/ProcDump-for-Linux.git
  2. cd ProcDump-for-Linux
  3. make

System information (e.g., distro, kernel version, etc.)

gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

make --version GNU Make 3.81

josalem commented 6 years ago

The makefile now includes -std=gnu99 after #21 was merged in. That should fix what you're seeing. Retry building off the development branch.