🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.mac.scitech
2 messages
2 total messages Started by Georg Schwarz Thu, 30 Jun 1994 06:04
linking with GCC on the Mac?? Libraries?? Please Help!
#20
Author: Georg Schwarz
Date: Thu, 30 Jun 1994 06:04
69 lines
3832 bytes
I`d appreciate a lot if you could take the time to read the following
and perhaps even reply if you have an idea of what the problem might be:

I will have to develop some smaller C programmes  (some hundreds of
lines of code at the most) to run on a UNIX workstation.
I thought that for my needs, GCC looked like a good choice to write and
perhaps test those programmes on my Macintosh, which is just a Performa
400 (16 MHz 68030, no FPU) 6/40. I am using System D1-7.1P.
The programmes I have to write will perform some calculations. They read
their input from a file and write their output to another one, so I do
not even need screen output, which of course would be nice, but probably
rather difficult to implement on the Mac due to the lack of a standard
text line based interface. Or are there any solutions available? 

Not having the MPW, I obtained the standalone version of GCC found
at nic.switch.ch.
The most important problem I am facing right now is linking. It looks
like I do not understand the concept of suitcases.
For testing purposes, I have written the following little patch of
code:

#include <stdio.h>
void main(void)
{
FILE *fp;
if((fp=fopen("testfile","w"))!=NULL)
{
fputc((int)"a",fp);
fclose(fp);
}
}

which should create a file called "testfile" containing the character
"a".
Preprocessing, Compiling and Assembling went fine.
I have obtained the MPW headers and libraries from ftp.apple.com and
added the folders I keep them in in to the search path. Is that OK?

Now, when I try to link it, I get
Untitled.o: Undefined symbol _fopen referenced from text segment
Untitled.o: Undefined symbol _fputc referenced from text segment
Untitled.o: Undefined symbol _fclose referenced from text segment

What am I doing wrong??? (obviously these functions do not exist or
cannot be found?)

I made a second attempt, opening the stdio.suit suitcase that comes with
GCC before assembling. After assembling, I opened the DRVR entry in the
stdio.suit to find that my .o file had just been added in there. I then
selected all the entries in the DRVR window (maybe it would be better
just to select some entries, but I cannot select them except in a
contiguous range) and linked. I got dozens of errors like
wsetup.o: Undefined symbol _free referenced from text segment
vsscanf.o: Undefined symbol _strlen referenced from text segment
vfscanf.o: Undefined symbol __ctype_ referenced from text segment
just to quote the first ones. :-(((

How can I successfully link my programme???

Do I need the files from ftp.apple.com for that?
What are the files found in the archives gcc-1.37-includes.sit and
GCC_1.37.1r14_libsrc.sit which I also got from nic.switch.ch for?? Do I
need them for the sample programme above??

Any help would be greatly appreciated.
Thanks a lot!

(Yes, I did read all the help texts. Nevertheless, I do not have a clue
how to proceed.)
Re: linking with GCC on the Mac?? Libraries?? Please Help!
#21
Author: Philip Ryan
Date: Thu, 30 Jun 1994 23:42
13 lines
1575 bytes
From memory reading about the release of GCC for the Mac, I was disappointed 
to find that it was not a complete port... one still needed to use either the 
MPW or Think C libraries.

The gcclibsrc.sit files that you mentioned may well contain a complete set of 
library routines that will be necessary for the proper use of GCC on the Mac, 
but I wouldn't hold my breath.

I know that it is a cop-out, but _buying_ Think C or Symantec C++ for the Mac 
is not really all _that_ expensive, particularly if you're a student.

Phil Ryan
Melbourne
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads