stdio.h - not found

YDL running on the Sony Playstation 3

Moderator: billb

stdio.h - not found

Postby nestor » 12 Aug 2010, 00:55

Hi
I am trying to compile Arcem, the Acorn Archimedes emulator from source following billb's "hard way" guide.
Before I started, I installed the following development libraries with the Gnome package manager
- Development libraries
- Legacy software development
- X Software development

I then changed the variable ENDIAN variable in the makefile to BIGEND, save that and ran make
Here's what I get:

Code: Select all
[nestor@localhost arcem]$ make
cc -O3 -DBIGEND  -DNOOS -DNOFPE -Wall -Wno-return-type -Wno-unknown-pragmas -Wshadow -Wundef -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wcast-qual -Werror    -IX -Iarch -funroll-loops -fexpensive-optimizations -ffast-math -fomit-frame-pointer -frerun-cse-after-loop -DSYSTEM_X -I/usr/X11R6/include -c armcopro.c
In file included from armcopro.c:18:
armdefs.h:22:19: error: stdio.h: No such file or directory
armdefs.h:23:20: error: stdlib.h: No such file or directory
In file included from armdefs.h:63,
                 from armcopro.c:18:
arch/archio.h:5:20: error: signal.h: No such file or directory
In file included from arch/DispKbd.h:10,
                 from arch/armarc.h:7,
                 from armdefs.h:64,
                 from armcopro.c:18:
/usr/include/X11/Xlib.h:52:23: error: sys/types.h: No such file or directory
In file included from arch/armarc.h:9,
                 from armdefs.h:64,
                 from armcopro.c:18:
arch/fdc1772.h:10: error: expected specifier-qualifier-list before ‘FILE’
In file included from arch/armarc.h:10,
                 from armdefs.h:64,
                 from armcopro.c:18:
arch/hdc63463.h:42: error: expected specifier-qualifier-list before ‘FILE’
make: *** [armcopro.o] Error 1
[nestor@localhost arcem]$


Any idea why stdio.h and other libraries aren't found?
Google tells me these are the very basic ones ...
What do i need to install to get them?

Thanks!

nestor
nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby aguilarojo » 12 Aug 2010, 06:17

nestor wrote:Hi
I am trying to compile Arcem, the Acorn Archimedes emulator from source following billb's "hard way" guide.
Before I started, I installed the following development libraries with the Gnome package manager
- Development libraries
- Legacy software development
- X Software development

I then changed the variable ENDIAN variable in the makefile to BIGEND, save that and ran make
Here's what I get:

Code: Select all
[nestor@localhost arcem]$ make
cc -O3 -DBIGEND  -DNOOS -DNOFPE -Wall -Wno-return-type -Wno-unknown-pragmas -Wshadow -Wundef -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wcast-qual -Werror    -IX -Iarch -funroll-loops -fexpensive-optimizations -ffast-math -fomit-frame-pointer -frerun-cse-after-loop -DSYSTEM_X -I/usr/X11R6/include -c armcopro.c
In file included from armcopro.c:18:
armdefs.h:22:19: error: stdio.h: No such file or directory
armdefs.h:23:20: error: stdlib.h: No such file or directory
In file included from armdefs.h:63,
                 from armcopro.c:18:
arch/archio.h:5:20: error: signal.h: No such file or directory
In file included from arch/DispKbd.h:10,
                 from arch/armarc.h:7,
                 from armdefs.h:64,
                 from armcopro.c:18:
/usr/include/X11/Xlib.h:52:23: error: sys/types.h: No such file or directory
In file included from arch/armarc.h:9,
                 from armdefs.h:64,
                 from armcopro.c:18:
arch/fdc1772.h:10: error: expected specifier-qualifier-list before ‘FILE’
In file included from arch/armarc.h:10,
                 from armdefs.h:64,
                 from armcopro.c:18:
arch/hdc63463.h:42: error: expected specifier-qualifier-list before ‘FILE’
make: *** [armcopro.o] Error 1
[nestor@localhost arcem]$


Any idea why stdio.h and other libraries aren't found?
Google tells me these are the very basic ones ...
What do i need to install to get them?

Thanks!

nestor


Hi Nestor!

In the C programming language files ending in .h are known as header files which contain references which are usually called by other files. There are courses and reference texts discussing header files and other aspects of C in great detail which are commonly available. Keep in mind that C is the language which built Unix/Linux so there should be some reference somewhere which should appeal to you.

One of my favorite technical authors is Bruce Eckel, reading his work Thinking in C could be useful.

The nature of the errors you are seeing are basically of two different categories:


  • Header files used by C.
  • Header files used by the X window system which is the fundamental window manager within Unix/Linux. Keep in mind what I said earlier, nearly every tool, function and system within Linux/Unix is developed or built from C. The difference to keep in mind is that the header file referring to the X window system is unique to it (Xlib.h) and not a member of those libraries comprising the C language itself.

Using the above information to your advantage:

Make sure that your yum.repos.d directory has as many repositories available that you believe you need; there are discussion threads on the YDL Board regarding which repositories are recommended. Here is what yum reports on my system after the above has been completed:

Code: Select all
# yum info "gcc*"
Loading "protectbase" plugin
Loading "installonlyn" plugin
0 packages excluded due to repository protections
Installed Packages
Name   : gcc
Arch   : ppc
Version: 4.1.2
Release: 44
Size   : 10 M
Repo   : installed
Summary: Various compilers (C, C++, Objective-C, Java, ...)

Description:
The gcc package contains the GNU Compiler Collection version 4.1.
You'll need this package in order to compile C code.


Name   : gcc-c++
Arch   : ppc
Version: 4.1.2
Release: 44
Size   : 8.0 M
Repo   : installed
Summary: C++ support for GCC

Description:
This package adds C++ support to the GNU Compiler Collection.
It includes support for most of the current C++ specification,
including templates and exception handling.


Name   : gcc-gfortran
Arch   : ppc
Version: 4.1.2
Release: 44
Size   : 9.5 M
Repo   : installed
Summary: Fortran 95 support

Description:
The gcc-gfortran package provides support for compiling Fortran 95
programs with the GNU Compiler Collection.


Name   : gcc-java
Arch   : ppc
Version: 4.1.2
Release: 44
Size   : 6.8 M
Repo   : installed
Summary: Java support for GCC

Description:
This package adds support for compiling Java(tm) programs and
bytecode into native code.


Name   : gcc-objc
Arch   : ppc
Version: 4.1.2
Release: 44
Size   : 6.6 M
Repo   : installed
Summary: Objective-C support for GCC

Description:
gcc-objc provides Objective-C support for the GCC.
Mainly used on systems running NeXTSTEP, Objective-C is an
object-oriented derivative of the C language.


Name   : gcc-objc++
Arch   : ppc
Version: 4.1.2
Release: 44
Size   : 6.8 M
Repo   : installed
Summary: Objective-C++ support for GCC

Description:
gcc-objc++ package provides Objective-C++ support for the GCC.


#


You can use either yum or the Add/Remove application to acquire, update and install gnuc which is invoked by using gcc not cc. The Add/Remove application uses yum anyway so having yum using the approved repositories is an advantage as all the packages, updates and dependencies will be there as though they were located in one place. It won't make a difference to yum if it is working through three or more repositories looking for what interests you, where yum is most useful is determining for you which dependencies are necessary for each package. Here is a link discussing more details which may be useful.

Note that by using the info flag you can discover whether something is installed or available elsewhere and not installed. Let's say you wanted to make sure that you have all the packages for x11 the x windows server. Using yum you execute:

Code: Select all

# yum info "x*11*"
Loading "protectbase" plugin
Loading "installonlyn" plugin
0 packages excluded due to repository protections
Installed Packages
Name   : x3270-x11
Arch   : ppc
Version: 3.3.4p7
Release: 5.fc6
Size   : 692 k
Repo   : installed
Summary: IBM 3278/3279 terminal emulator for the X Window System

Description:
The x3270 program opens a window in the X Window System which emulates
the actual look of an IBM 3278/3279 terminal, commonly used with
mainframe applications.  x3270 also allows you to telnet to an IBM
host from the x3270 window.

Install the x3270-x11 package if you need to access IBM hosts using an IBM
3278/3279 terminal emulator from X11.


Name   : xorg-x11-apps
Arch   : ppc
Version: 7.1
Release: 4.0.1
Size   : 632 k
Repo   : installed
Summary: X.Org X11 applications

Description:
A collection of common X Window System applications.
 
...snipped...

Name   : xorg-x11-drivers
Arch   : ppc
Version: 7.3
Release: 4
Size   : 5.5 k
Repo   : base
Summary: X.Org X11 driver installation package
Description:
The purpose of this package is to require all of the individual X.Org
driver rpms, to allow the OS installation software to install all drivers
all at once, without having to track which individual drivers are present
on each architecture.  By installing this package, it forces all of the
individual driver packages to be installed.



In Linux it can be annoying to think one is ready to compile something only to discover one is missing one or another package. Invoking the info flag within yum can shorten the mystery regarding what one has and what one can get very quickly. If you need a package more current than what is in the repositories then you will have to go to the webpage of the developers to acquire the latest version in source and compile it within your system.

Eventually you should be able to complete your original intention.

All the best...
Last edited by aguilarojo on 14 Aug 2010, 19:41, edited 1 time in total.

Everything on the Earth has a purpose.
Every disease an herb to cure it.
And every person has a mission.
This is the Indian Theory of Existence.
-- Morning Dove, Salish (1888-1936)
User avatar
aguilarojo
ydl guru
ydl guru
 
Posts: 227
Joined: 06 May 2009, 14:50
Location: New York City

Re: stdio.h - not found

Postby nestor » 12 Aug 2010, 10:28

Thank you very much for your very detailed post!

I do have a very rudimentary knowlegde of C and linux although not necessarily of the terminology. But I have a lot to learn and I *will* look at the links you posted.

But I am also very much a learning by doing guy. So let me give you a bit more detail on how I got stuck:

(1) The original error message was longer because the Xlib.h header was missing. I googled, figured out the xorg development package is missing and resolved it with
yum install xorg-devel
[By the why, I've got the YDL 6.2 standard repos plus ps3bodega enabled as described in the link you posted]

(2) I was then stuck with the error message I posted. From what I understand by a quick google search (and what I am sure I will understand better after reading your links...), the 'missing' files are fairly standard header files for C.

(3) So I tried
yum info gcc*
There is a whole bunch of packages installed and what isn't (mostly various tools) didn't seem obviously relevant to me from the description.
(I can post the output this evening as I am at work now).

But basically my question is: how can I figure out what package (e.g. gcc or other) I need to (yum) install that contain the missing header files (stdio.h ect)? I would have thought this should be included with the "standard" gcc package?

Thanks!

Nestor
nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby ppietro » 12 Aug 2010, 11:30

nestor wrote:But basically my question is: how can I figure out what package (e.g. gcc or other) I need to (yum) install that contain the missing header files (stdio.h ect)? I would have thought this should be included with the "standard" gcc package?


Google is probably your best friend here.

I did a search for this:
http://www.google.com/search?sourceid=c ... pm+stdio.h

and it tells me that CentOS (which YDL is based on) does have some issues with this. Particularly, this post seems relevant:
http://www.linuxquestions.org/questions ... ry-685758/

Can you check to see if the "glibc-headers" package is installed? Using YUM to install that seemed to fix the issue mentioned in the thread. The original poster mentioned installing:

> Development Tools (default selected)
> Legacy Software Development
> Development Libraries (default selected)

but still glibc-headers didn't install, for some reason.

Cheers,
Paul
User avatar
ppietro
Site Admin
Site Admin
 
Posts: 4965
Joined: 13 Sep 2007, 22:18

Re: stdio.h - not found

Postby nestor » 12 Aug 2010, 12:15

Cheers I will check and report back this evening...

Also, aguilarojo said in his response:
You can use either yum or the Add/Remove application to acquire, update and install gnuc which is invoked by using gcc not cc.


Which I will also try. But the make file seems to use "cc". So I guess I need to check and install relevant "cc" packages? Correct? If so, which ones?
nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby billb » 12 Aug 2010, 17:26

Got it built OK I think ... as soon as I figure out how I'll let you know. :lol:

EDIT:

You need:
glibc-devel
libX11-devel
libXau-devel
libXdmcp-devel
libXext-devel

Also, you may need to disable warnings as errors in the Makefile. Look for -werror in the makefile and remove that.

And it has problems using YDL's gcc so you may also need to install compat-gcc-34 and specify gcc34 on the make line like so:
Code: Select all
make cc="gcc34"


And check the manual for ROM requirements ...

http://arcem.sourceforge.net/manual.html#romimages

Also I looked at the .spec file from the SRPM for that package on RPMFusion and it appears they use the CVS version of the code instead of 1.0 as well as several patches, and they indicate there may be problems with sound on PPC:

Code: Select all
# Sound support seems stable but experimental, but largely doesn't work on PPC


Aside from all that, the text & graphics appear garbled in the "Arc emulator - Main display" window when I run it. Have fun! :D
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: stdio.h - not found

Postby nestor » 13 Aug 2010, 01:31

Oh well... doesn't sound very good does it?

billb wrote:You need:
glibc-devel
libX11-devel
libXau-devel
libXdmcp-devel
libXext-devel


All of these were installed. The missing package was "glibc-headers" as mentioned by ppietro (THANKS!).


Also, you may need to disable warnings as errors in the Makefile. Look for -werror in the makefile and remove that.
And it has problems using YDL's gcc so you may also need to install compat-gcc-34 and specify gcc34 on the make line like so:
Code: Select all
make cc="gcc34"



I am getting a feeling we are trying to compile different versions. I tried to compile this: http://sourceforge.net/projects/arcem/files/arcem/1.00/arcem-1.00-src.tgz
It threw up a declaration error in one of the .c files (armrdi.c). I removed the static declaration causing the trouble -- Just for the fun to see whether it then compiled anything. It did. But when I tried to run the resulting executable file, it complained about not having a config file...

Anyway, thanks for all your efforts! I'll try again tomorrow, if I find the time. Got to sleep now.

Cheers!
nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby billb » 13 Aug 2010, 02:23

nestor wrote:Oh well... doesn't sound very good does it?


Not so much, but I've built an RPM for it anyway using the SRPM from RPMFusion ... will see what that does (it's using the newer CVS code instead of 1.0).
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: stdio.h - not found

Postby nestor » 13 Aug 2010, 11:01

nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby billb » 13 Aug 2010, 11:39

The one for fc11 (Fedora 11) is what I rebuilt from for YDL 6.2 -- haven't tested yet, though.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: stdio.h - not found

Postby billb » 13 Aug 2010, 15:12

This seems to work properly ... I just don't know how to use it yet. :P

Here's the RPM:
http://pleasantfiction.ipower.com/ps3li ... dg.ppc.rpm

And SRPM:
http://pleasantfiction.ipower.com/ps3li ... dg.src.rpm

EDIT:

This RPM installs a wrapper script for arcem which creates a $HOME/.arcem directory ... as noted in the manual, you can grab a RISC OS 3.1 ROM from the !A310emu site. Your ~/.arcem directory is where you put that ROM and hard and floppy disk images.

The .arcemrc config file goes in your home directory and that's where you specify details about the hard drive(s).

http://arcem.sourceforge.net/manual.html#romimages
Code: Select all
Alternate sources of ROM images, you can download a copy of the RISC OS 3.10 ROM image as a support file from the !A310emu website, it's in the file support2.zip and is called ro310, you should rename ro310 to ROM before using it with ArcEm.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: stdio.h - not found

Postby nestor » 13 Aug 2010, 23:31

Wow -- thank you very much!!!

I am going to use it to play the Archimedes version of Elite, the classic game. Apparently the Archimedes version is considered "the best version ever".
http://home.clara.net/iancgbell/elite/arc/index.htm

You have to rename the floppy image to FloppyImage0 (or ..1 etc) and place it in the .arcem folder.
In the Emulator you then have to go to Apps -> Configure -> Floppies to display the floppy icon.

From there the game can be launched. Seems to work fine. Only downside is that the sound doesn't work. Oh well....

Thanks very much again!
nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby billb » 14 Aug 2010, 00:12

nestor wrote:I am going to use it to play the Archimedes version of Elite, the classic game. Apparently the Archimedes version is considered "the best version ever".
http://home.clara.net/iancgbell/elite/arc/index.htm


Cool I'll have to check that out, too -- I was wondering what I was going to do with it now that it's running! :)
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: stdio.h - not found

Postby nestor » 17 Aug 2010, 10:00

Hi billb --
I am trying to learn how to compile stuff. So I thought it would be a good exercise to recompile Arcem from the SRAM you posted.
I've "rpm -i"'d and "rpmbuild -bp"'d the source, edited the Makefile environment variable HOST_BIGENDIAN=yes and have then run make and make install.
I then manually copied the wrapper script arcem.sh file to /usr/bin/arcem.
This seems to have worked. So I guess it's a success!
However, it seems that my version of the compiled arcem.bin runs a bit slower than yours.
Any idea why that may be? Are there any other changes I should have made to the Makefile?
Thanks
nestor
nestor
ydl newbie
ydl newbie
 
Posts: 9
Joined: 10 Jun 2010, 12:17
Location: London, UK

Re: stdio.h - not found

Postby billb » 17 Aug 2010, 12:18

I don't see anything obvious that would affect the speed. I'm pretty sure I have sound completely disabled, but that's the default setting in the Makefile.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Next

Return to Playstation 3

Who is online

Users browsing this forum: No registered users and 60 guests