Discussion:
Compiling with GCC
(too old to reply)
Howard West
2004-06-14 23:15:59 UTC
Permalink
This has to be a newby 101 question, but I'm getting ready to work on
a vanilla C development project on SCO 5.0.2 and 5.0.5 and I'm having
the damndest time getting the most basic "hello, world" program to
build.

I don't particularly understand the file structure for the system
headers and such. They are buried deeply in a directory structure
that I don't find very intuitive. I saw something here that indicated
one should pass a "-v" argument to the compiler, which looked a little
better, but it still missed my include of "stdio.h" by one
subdirectory level.

Am I simply going to have to build and INCLUDE environment variable
that points to each one of these monsters, or is there some way to get
them exposed at a higher level in the directory structure?
Jean-Pierre Radley
2004-06-14 23:42:45 UTC
Permalink
Howard West typed (on Mon, Jun 14, 2004 at 04:15:59PM -0700):
| This has to be a newby 101 question, but I'm getting ready to work on
| a vanilla C development project on SCO 5.0.2 and 5.0.5 and I'm having
| the damndest time getting the most basic "hello, world" program to
| build.
|
| I don't particularly understand the file structure for the system
| headers and such. They are buried deeply in a directory structure
| that I don't find very intuitive. I saw something here that indicated
| one should pass a "-v" argument to the compiler, which looked a little
| better, but it still missed my include of "stdio.h" by one
| subdirectory level.
|
| Am I simply going to have to build and INCLUDE environment variable
| that points to each one of these monsters, or is there some way to get
| them exposed at a higher level in the directory structure?

What are you complicating?? stdio.h lives in /usr/include, and any
compiler at all would use that directory to find it.

What is your program, and what is your compiling command?
--
JP
J. L. Schilling
2004-06-15 10:41:48 UTC
Permalink
Post by Howard West
This has to be a newby 101 question, but I'm getting ready to work on
a vanilla C development project on SCO 5.0.2 and 5.0.5 and I'm having
the damndest time getting the most basic "hello, world" program to
build.
I don't particularly understand the file structure for the system
headers and such. They are buried deeply in a directory structure
that I don't find very intuitive. I saw something here that indicated
one should pass a "-v" argument to the compiler, which looked a little
better, but it still missed my include of "stdio.h" by one
subdirectory level.
For GCC there is indeed a complication where some system headers,
instead of being found in the /usr/include/ hiearchy, are found
within the GCC distribution structure. This is because those headers
need to be edited so that the GCC compiler can handle them.

Attached is what a gcc -v looks like on a OSR 5.0.5 system here.
What does it look like on yours?

Jonathan Schilling

213$ cat hello.c
#include <stdio.h>

int main()
{
printf("Hello, I must be \
going\n");
}
211$ /usr/local/bin/gcc -v hello.c
Reading specs from /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/cpp -lang-c -v
-D__GNUC__=2 -D__GNUC_MINOR__=95 -Asystem(svr3) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -D__i386 -D__unix
-D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX -D_STRICT_NAMES
-D_SCO_XPG_VERS=4 -D_M_I86 -D_M_I86SM -D_M_INTERNAT -D_M_SDATA
-D_M_STEXT -D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII
-D_M_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX -D_SCO_ELF
-D_SCO_C_DIALECT=1 hello.c /usr/tmp/ccFucxkR.i
GNU CPP version 2.95.2 19991024 (release) (i386, SCO OpenServer 5
Syntax)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/../../../../i386-pc-sco3.2v5.0.5/include
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search
path:
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/../../../../include/g++-3
End of omitted list.
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/cc1
/usr/tmp/ccFucxkR.i -quiet -dumpbase hello.c -version -o
/usr/tmp/cc3FijaU.s
GNU C version 2.95.2 19991024 (release) (i386-pc-sco3.2v5.0.5)
compiled by GNU C version 2.95.2 19991024 (release).
/usr/ccs/bin/as -b elf -Ea,XPG4PLUS,ELF -Qn -o /usr/tmp/ccrGQ7yG.o
/usr/tmp/cc3FijaU.s
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/collect2 -b elf
-Ra,XPG4PLUS,ELF -YP,/usr/ccs/lib:/lib:/usr/lib -Qn
/usr/ccs/lib/crt1.o /usr/ccs/lib/values-Xa.o
/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/crtbegin.o
-L/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2 -L/usr/ccs/bin
-L/usr/ccs/lib -L/usr/local/lib /usr/tmp/ccrGQ7yG.o -lgcc -lcrypt
-lgen -lc -lgcc /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/crtend.o
/usr/ccs/lib/crtn.o
212$ ./a.out
Hello, I must be going
Robert Lipe
2004-06-16 15:58:23 UTC
Permalink
Post by J. L. Schilling
For GCC there is indeed a complication where some system headers,
instead of being found in the /usr/include/ hiearchy, are found
within the GCC distribution structure. This is because those headers
need to be edited so that the GCC compiler can handle them.
But if you, as a user of GCC, ever have to know this, something is wrong.

In fact, if you find yourself typing '-I anything' for a simple "hello
world" program, something is wrong.

Describe what compiler you're using, where you got it, the error your
getting, and so on.
Howard West
2004-06-17 20:22:55 UTC
Permalink
Post by Robert Lipe
Post by J. L. Schilling
For GCC there is indeed a complication where some system headers,
instead of being found in the /usr/include/ hiearchy, are found
within the GCC distribution structure. This is because those headers
need to be edited so that the GCC compiler can handle them.
But if you, as a user of GCC, ever have to know this, something is wrong.
In fact, if you find yourself typing '-I anything' for a simple "hello
world" program, something is wrong.
Describe what compiler you're using, where you got it, the error your
getting, and so on.
I think I've made a little progress here. I think the problem was
that not everything required from the installation CD had been
installed. I ran into a problem regarding a missing "as" and found
some messages through Google indicating that the "Application
Development Libraries and Linker" or something similar needed to be
installed.

These were dutifully installed with the SCO 5.02 installation CD and
now there are symbolic links between /usr/include and the really deep
directories for all the standard header files, so that seems to be
taken care of.

I am still encountering a message stating that "as" is missing, so the
compiler won't build anything. The messages I saw earlier this week
seemed to indicate that this would be corrected by adding the package
noted above, but it doesn't look like it was.

Any tips on that? As I said, the SCO OpenServer version is 5.02 and
the gcc version is 2.95.2. I also have a number of the other GNU
tools installed from the Skunkware CDROM.
Jean-Pierre Radley
2004-06-17 22:01:19 UTC
Permalink
Howard West typed (on Thu, Jun 17, 2004 at 01:22:55PM -0700):
| Robert Lipe <***@usa.net> wrote in message news:<***@rjloud.caldera.com>...
| > On 15 Jun 2004 03:41:48 -0700, J. L. Schilling <***@my-deja.com> wrote:
| >
| > > For GCC there is indeed a complication where some system headers,
| > > instead of being found in the /usr/include/ hiearchy, are found
| > > within the GCC distribution structure. This is because those headers
| > > need to be edited so that the GCC compiler can handle them.
| >
| > But if you, as a user of GCC, ever have to know this, something is wrong.
| >
| > In fact, if you find yourself typing '-I anything' for a simple "hello
| > world" program, something is wrong.
| >
| > Describe what compiler you're using, where you got it, the error your
| > getting, and so on.
|
| I think I've made a little progress here. I think the problem was
| that not everything required from the installation CD had been
| installed. I ran into a problem regarding a missing "as" and found
| some messages through Google indicating that the "Application
| Development Libraries and Linker" or something similar needed to be
| installed.
|
| These were dutifully installed with the SCO 5.02 installation CD and
| now there are symbolic links between /usr/include and the really deep
| directories for all the standard header files, so that seems to be
| taken care of.
|
| I am still encountering a message stating that "as" is missing, so the
| compiler won't build anything. The messages I saw earlier this week
| seemed to indicate that this would be corrected by adding the package
| noted above, but it doesn't look like it was.
|
| Any tips on that? As I said, the SCO OpenServer version is 5.02 and
| the gcc version is 2.95.2. I also have a number of the other GNU
| tools installed from the Skunkware CDROM.

The assembler for 5.0.0 and 5.0.2 is provided in tls706, which you can
ftp from stage.sco.com/TLS.
--
JP
Howard West
2004-06-18 14:49:39 UTC
Permalink
Post by Jean-Pierre Radley
| >
| > > For GCC there is indeed a complication where some system headers,
| > > instead of being found in the /usr/include/ hiearchy, are found
| > > within the GCC distribution structure. This is because those headers
| > > need to be edited so that the GCC compiler can handle them.
| >
| > But if you, as a user of GCC, ever have to know this, something is wrong.
| >
| > In fact, if you find yourself typing '-I anything' for a simple "hello
| > world" program, something is wrong.
| >
| > Describe what compiler you're using, where you got it, the error your
| > getting, and so on.
|
| I think I've made a little progress here. I think the problem was
| that not everything required from the installation CD had been
| installed. I ran into a problem regarding a missing "as" and found
| some messages through Google indicating that the "Application
| Development Libraries and Linker" or something similar needed to be
| installed.
|
| These were dutifully installed with the SCO 5.02 installation CD and
| now there are symbolic links between /usr/include and the really deep
| directories for all the standard header files, so that seems to be
| taken care of.
|
| I am still encountering a message stating that "as" is missing, so the
| compiler won't build anything. The messages I saw earlier this week
| seemed to indicate that this would be corrected by adding the package
| noted above, but it doesn't look like it was.
|
| Any tips on that? As I said, the SCO OpenServer version is 5.02 and
| the gcc version is 2.95.2. I also have a number of the other GNU
| tools installed from the Skunkware CDROM.
The assembler for 5.0.0 and 5.0.2 is provided in tls706, which you can
ftp from stage.sco.com/TLS.
Thanks. Unfortunately that server doesn't seem to be accepting
connections. I guess I'll just need to keep trying.

Loading...