gcc in Xenial

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
ibelieveinpup
Posts: 7
Joined: Sat 26 Jan 2019, 16:22

gcc in Xenial

#1 Post by ibelieveinpup »

Hello,

Was trying to use Puppy on an old laptop at home. I installed gcc through the ppm. When attempting to compile, I get this error message:

fatal error: stdio.h: No such file or directory
compilation terminated.


I attempted to find stdio.h on my system with:

find / -iname 'stdio.h' -print

but it yielded nothing. I feel like there is something simple that I am missing, since stdio.h would be included with gcc at a minimum.

Any help would be much appreciated.

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#2 Post by puppy_apprentice »

You should use special package for developers called like this:

devx_name_of_puppy..sfs

Load that file via menu:

Setup->SFS-Load on-the-fly

ibelieveinpup
Posts: 7
Joined: Sat 26 Jan 2019, 16:22

New Error

#3 Post by ibelieveinpup »

After installing devx through quickpet, I get a new error message:

gcc movmass.c -o movmass
In file included from /usr/include/stdio.h:27:0,
from movmass.c:25:
/usr/include/features.h:367:25: fatal error: /usr/include/sys/cdefs.h: Too many levels of symbolic links
compilation terminated.

find has a new result too.

root# find / -iname 'stdio.h' -print
/initrd/pup_ro3/usr/include/bits/stdio.h
/initrd/pup_ro3/usr/include/bsd/stdio.h
/initrd/pup_ro3/usr/include/c++/4.7/tr1/stdio.h
/initrd/pup_ro3/usr/include/c++/5/tr1/stdio.h
/initrd/pup_ro3/usr/include/diet/stdio.h
/initrd/pup_ro3/usr/include/stdio.h
/usr/include/bsd/stdio.h
/usr/include/c++/4.7/tr1/stdio.h
/usr/include/c++/5/tr1/stdio.h
/usr/include/diet/stdio.h
/usr/include/stdio.h

ibelieveinpup
Posts: 7
Joined: Sat 26 Jan 2019, 16:22

@puppy_apprentice

#4 Post by ibelieveinpup »

Hello,

Thank you for the reply. I just saw your post after I posted my update.

It appears that the sfs is already loaded as I get this message in the SFS dialog box
devx_xenialpup_7.5.sfs seems already loaded. Do you want to unload?

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#5 Post by puppy_apprentice »

I don't know if you succeed or not.

When i compile c programs i do this:

1) load devx SFS (it include GCC and standard libraries and etc., so no need to use extra pet to compile most c programs)

2) before you compile any program that is not yours check if configure script exist, if yes run it as first, it will check if your Puppy has all stuff needed to compile this program

3) if you get error read carefully messages printed by configure, you will see what is missing

4) if there is no errors run make command

5) if make command finish with success make pet package

And if you have not success you can ask for help there:
http://www.murga-linux.com/puppy/index.php?f=62

User avatar
6502coder
Posts: 677
Joined: Mon 23 Mar 2009, 18:07
Location: Western United States

#6 Post by 6502coder »

@ibelieveinpup

You said you installed gcc through the PPM. As puppy_apprentice explained, the stuff you need to compile C programs, including gcc, is already in the devx SFS, which you seem to have found and installed. But did you remember to UNINSTALL gcc through the PPM? If not, that may be causing conflicts with what's in the devx SFS.

ibelieveinpup
Posts: 7
Joined: Sat 26 Jan 2019, 16:22

This is what I have tried

#7 Post by ibelieveinpup »

Thank you for all of the suggestions. Below is what I have attempted.


From SFS-Load on-the-fly, I removed devx. Then from ppm I removed gcc and all of its dependencies. Then I reloaded devx from SFS On-the-fly, and am the same message:

In file included from /usr/include/stdio.h:27:0,
from hello.c:1:
/usr/include/features.h:367:25: fatal error: /usr/include/sys/cdefs.h: Too many levels of symbolic links
compilation terminated.

root# ls -l /usr/include/sys/cdefs.h
lrwxrwxrwx 1 root root 29 Jan 14 2018 /usr/include/sys/cdefs.h -> ../i386-linux-gnu/sys/cdefs.h

root# file /usr/include/sys/cdefs.h
/usr/include/sys/cdefs.h: broken symbolic link to ../i386-linux-gnu/sys/cdefs.h

Does this broken symbolic link just need to be fixed by connecting to any copy of cdefs.h on my system? Does it matter which one? If so, wouldn't all of the files in that directory have a broken link, since there doesn't appear to be a /i386-linus-gnu directory? Will they fail too if ever needed?

Not sure why this directory would not be where it should be.

root# find / -iname 'cdefs.h' -print
/initrd/pup_ro3/usr/include/bsd/sys/cdefs.h
/initrd/pup_ro3/usr/include/diet/sys/cdefs.h
/initrd/pup_ro3/usr/include/sys/cdefs.h
/initrd/pup_ro3/usr/include/unistring/cdefs.h
/initrd/mnt/dev_save/xenialpup7.5frugal/xenialpupsave-steven/usr/include/sys/cdefs.h
/usr/include/sys/cdefs.h
/usr/include/bsd/sys/cdefs.h
/usr/include/diet/sys/cdefs.h
/usr/include/unistring/cdefs.h
find: ‘/proc/16354’: No such file or directory
find: ‘/proc/16369’: No such file or directory
find: ‘/proc/16370’: No such file or directory
find: ‘/proc/16371’: No such file or directory
find: ‘/proc/16372’: No such file or directory
find: ‘/proc/16373’: No such file or directory
find: ‘/proc/16376’: No such file or directory
find: ‘/proc/16377’: No such file or directory
find: ‘/proc/16378’: No such file or directory


Before I realized that devx had everything that I needed, I installed gcc from ppm, which seems to have caused some problems. Even after removing gcc and its dependencies via ppm, and just loading devx via SFS On-the-fly, gcc will not compile.

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#8 Post by puppy_apprentice »

Try to boot Xenial without your save file, load devx and try compile your c program.

If no success attach your program to your next post or post url link to project page of this c program.

ibelieveinpup
Posts: 7
Joined: Sat 26 Jan 2019, 16:22

Success without the pup save folder

#9 Post by ibelieveinpup »

puppy_apprentice wrote:Try to boot Xenial without your save file, load devx and try compile your c program.

If no success attach your program to your next post or post url link to project page of this c program.
Thank you for that suggestion. Gcc worked as expected without the save folder used.

So that means that the problem is somewhere inside of the save folder. IS it possible to dx and repair that without just deleting it and starting over?

ITSMERSH

Re: Success without the pup save folder

#10 Post by ITSMERSH »

ibelieveinpup wrote:
puppy_apprentice wrote:Try to boot Xenial without your save file, load devx and try compile your c program.

If no success attach your program to your next post or post url link to project page of this c program.
Thank you for that suggestion. Gcc worked as expected without the save folder used.

So that means that the problem is somewhere inside of the save folder. IS it possible to dx and repair that without just deleting it and starting over?
Yes, this should be possible, though it could be lots of work to do manually.

I won't recommend anything here, though I personally would create a new save file / save directory and start from scratch.

But I don't use save files / save directories, so don't follow my theoretical personal decision. Maybe some save file / save directory experts will have some better ways to present.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#11 Post by bigpup »

Is Puppy on a USB flash drive?
If yes.
Writes to the save file/folder are limited to pressing the desktop save icon or doing a shutdown.
Stuff is held in the save ramdisk, in memory, not the save file/folder.
Stuff you do in PPM does not get in or out of the save file/folder until you press the save button or shutdown.

So, your uninstall of GCC may not have actually gotten out of the save file/folder, yet.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

ibelieveinpup
Posts: 7
Joined: Sat 26 Jan 2019, 16:22

Thank You!

#12 Post by ibelieveinpup »

bigpup wrote:Is Puppy on a USB flash drive?
If yes.
Writes to the save file/folder are limited to pressing the desktop save icon or doing a shutdown.
Stuff is held in the save ramdisk, in memory, not the save file/folder.
Stuff you do in PPM does not get in or out of the save file/folder until you press the save button or shutdown.

So, your uninstall of GCC may not have actually gotten out of the save file/folder, yet.
Thank you very much for the help. Deleting the save folder and making a new one must have been the fresh start that devx needed to work properly. Gcc is now compiling like it should. Now I can get back to learning some C on this old laptop. :D

Post Reply