dschmenk/apple2pi

gcc compile failed on newly installed distro (also fixed)

KenKashmarek opened this issue · 0 comments

I download, prepared an SD card, and installed the RaspApple II distro. All went well including functions that were tried. However, I tried to compile a simple C program and got these messages:

pi@raspberrypi /media/A2SHARED/openssl $ gcc ssrnd.c
In file included from /usr/include/stdio.h:28:0,
from ssrnd.c:7:
/usr/include/features.h:356:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
pi@raspberrypi /media/A2SHARED/openssl $ man gcc
No manual entry for gcc
See 'man 7 undocumented' for help when manual pages are not available.

I checked the gcc version as follows:

pi@raspberrypi /media/A2SHARED/GSFILES/openssl $ cat /proc/version
Linux version 3.12.22+ (dc4@dc4-arm-01)
(gcc version 4.7.2 20120731 (prerelease)
(crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) )
#691 PREEMPT Wed Jun 18 18:29:58 BST 2014

This is backlevel from the standard Raspbian distro.

I ran the following commands to bring this distro up to date:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove

This was a very long process. The formerly missing file was now in place:

pi@raspberrypi /usr/include $ ls -l /usr/include/arm-linux-gnueabihf/sys/cdefs.h
-rw-r--r-- 1 root root 13326 Jul 29 02:22 /usr/include/arm-linux-gnueabihf/sys/cdefs.h

And, the compile of the C program now ran successfully.

FYI...the distro probably needs to be updated or users advised to make the updates after they are comfortable with the installation.