[comp.sys.atari.st.tech] fcvt/getch/getchar in GCC

heavy@zip.eecs.umich.edu (Richard Scott Hall) (03/26/91)

I was able to get GCC to work on my system (strangely it would
not work in MT C-Shell, but it works fine from the desktop).
But anyway, what I was wondering, I was compiling some files
that used fcvt (floating point to string), getch (wait for
a character), and getchar (get a char), but when went to link
the files these functions were undefined.  I am pretty sure that
GCC on the SUNS has fcvt and getchar (I am not sure about getch),
but does the ST version too?  If so, how do I link them in?

Another thing...

When I am linking, does GCC look through all the files in my
lib path or does it only look in a default file?  For instance,
if I want to compile a GEM program will I have to specify
'-lgemlib' ?

Richard Hall
University of Michigan
-- 

Standard disclaimer:  I am not me, I am who you think you are...
                      so don't blame me.

klamer@mi.eltn.utwente.nl (Klamer Schutte) (03/26/91)

In <1991Mar25.210909.21762@zip.eecs.umich.edu> heavy@zip.eecs.umich.edu (Richard Scott Hall) writes:

>I was able to get GCC to work on my system (strangely it would
>not work in MT C-Shell, but it works fine from the desktop).

Out of memory? GCC likes some!

>But anyway, what I was wondering, I was compiling some files
>that used fcvt (floating point to string), getch (wait for
>a character), and getchar (get a char), but when went to link
>the files these functions were undefined.  I am pretty sure that
>GCC on the SUNS has fcvt and getchar (I am not sure about getch),
>but does the ST version too?  If so, how do I link them in?

fcvt is an internal routine of the SUN. Use sprintf instead to be portable.
getch is a part of curses -- get a curses library. Or use Bconin. (i believe).
getchar should be in the standard library, Perhaps it is only a macro -- did
you include <stdio.h>?

>Another thing...

>When I am linking, does GCC look through all the files in my
>lib path or does it only look in a default file?  For instance,
>if I want to compile a GEM program will I have to specify
>'-lgemlib' ?

You will have to specify.

Klamer
-- 
Klamer Schutte
Faculty of electrical engineering -- University of Twente, The Netherlands
klamer@mi.eltn.utwente.nl	{backbone}!mcsun!mi.eltn.utwente.nl!klamer

heavy@zip.eecs.umich.edu (Richard Scott Hall) (03/27/91)

In article <klamer.669998332@mi.eltn.utwente.nl> klamer@mi.eltn.utwente.nl (Klamer Schutte) writes:
>>I was able to get GCC to work on my system (strangely it would
>>not work in MT C-Shell, but it works fine from the desktop).
>
>Out of memory? GCC likes some!
>
I have 4 Meg and I turned off much in my system, so I had well over
3 Meg to give to GCC, but it would not work even on a small program.
GCC seems to work well from MUPFEL too, oh well...

>
>fcvt is an internal routine of the SUN. Use sprintf instead to be portable.
>getch is a part of curses -- get a curses library. Or use Bconin. (i believe).
>getchar should be in the standard library, Perhaps it is only a macro -- did
>you include <stdio.h>?
>
I am trying to port a dBase file library from the IBM...it isn't easy
for me to go in and change a lot of code because it might adversely
affect other portions of this large amount of code that I don't know
about.  At any rate, I wrote my own version of fcvt() using sprintf,
seems to work fine.  As for getch/getchar, there was only one
reference to them so I took them out...everything seems to be working
fine not (I'll keep my fingers crossed).

Thanks for the info...

Another thing about libraries...if my library has something in it
that calls something else in the archive, to get it defined properly
at link time I have to specify my library twice ('-llibrary -llibrary')
or else it says the second function is undefined...is this suppose to
work this way?  Oh, and finally, if I write a GEM program, do I link
with crt0.o and gcrt0.o or just gcrt0.o?

>
>Klamer
>-- 
>Klamer Schutte
>Faculty of electrical engineering -- University of Twente, The Netherlands
>klamer@mi.eltn.utwente.nl	{backbone}!mcsun!mi.eltn.utwente.nl!klamer

Richard Hall
University of Michigan
-- 

Standard disclaimer:  I am not me, I am who you think you are...
                      so don't blame me.