sergev / qemu

QEMU for PIC32
https://github.com/sergev/qemu/wiki
Other
29 stars 7 forks source link

Compile issue, implicit declaration of function major #4

Open cratuki opened 4 years ago

cratuki commented 4 years ago

Hi Serge,

I am building on the latest Debian and working through some issues. I will raise issues as independent tickets, as you might not agree with all my solutions.

  1. Early in make, I get an error,

qga/commands-posix.c: In function ‘dev_major_minor’: qga/commands-posix.c:633:21: error: implicit declaration of function ‘major’; did you mean ‘_m_por’? [-Werror=implicit-function-declaration]
devmajor = major(st.st_rdev); ^~~~~
_m_por
qga/commands-posix.c:633:21: error: nested extern declaration of ‘major’ [-Werror=nested-externs] qga/commands-posix.c:634:21: error: implicit declaration of function ‘minor’; did you mean ‘mknod’? [-Werror=implicit-function-declaration]
devminor = minor(st.st_rdev); ^~~~~ mknod
qga/commands-posix.c:634:21: error: nested extern declaration of ‘minor’ [-Werror=nested-externs] cc1: all warnings being treated as errors make: *** [/home/cturner/opt/20200306.musicbox.cturner.ac.sergev.qemu.mips.pic32/qemu/rules.mak:57: qga/commands-posix.o] Error 1



This can be fixed by changing the import for sys/types.h to sys/sysmacros.h in the qga/commands-posix.c (source: https://github.com/hishamhm/htop/issues/663)