problem compiling library with GCC

problem compiling library with GCC

Post by Aaron Bentle » Sat, 30 Jan 1999 04:00:00



I've been programming on DOS for a while, but I'm pretty new to the unix
side, "make" etc.
I'm on a BSDI 4.0 machine.
I'm trying to use GCC to compile PDFlib,
http://www.ifconnection.de/~tm/
I've #defined the POSIX variable that seems to be required for a UNIX
build.
I've done "ln -s makefile.gcc makefile" (seems okay)
and "make test"
This is the result:
gcc  -o text2pdf  libpdf.a -lm
/usr/lib/crt1.o: In function `__start':
/usr/lib/crt1.o(.text+0x78): undefined reference to `main'
*** Error code 1

I've looked at text2pdf.c, and it DOES have a reference to "main"
What could be wrong?
Help!
--
Aaron Bentley
www.interlog.com/~abentley/music

 
 
 

problem compiling library with GCC

Post by Andrew Giert » Sat, 30 Jan 1999 04:00:00


 Aaron> I've done "ln -s makefile.gcc makefile" (seems okay)
 Aaron> and "make test"
 Aaron> This is the result:
 Aaron> gcc  -o text2pdf  libpdf.a -lm

This is not specifying any source or object files, only libraries.
That probably means that something in the makefile is broken.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
                           or <URL: http://www.whitefang.com/unix/>

 
 
 

problem compiling library with GCC

Post by Aaron Bentle » Sat, 30 Jan 1999 04:00:00


Ah, that makes more sense.  Now it says
"make: don't know how to make text2pdf.o. Stop"
I guess I'll have to read up on makefiles now.  Any suggestions where to look?


> Hint:
> Try "make" before "make test".
> Looks like there is only the link phase that starts, not the compile
> phase.
> Maybe a "make clean" would help as well.

> Markus


> > I've been programming on DOS for a while, but I'm pretty new to the unix
> > side, "make" etc.
> > I'm on a BSDI 4.0 machine.
> > I'm trying to use GCC to compile PDFlib,
> > http://www.ifconnection.de/~tm/
> > I've #defined the POSIX variable that seems to be required for a UNIX
> > build.
> > I've done "ln -s makefile.gcc makefile" (seems okay)
> > and "make test"
> > This is the result:
> > gcc  -o text2pdf  libpdf.a -lm
> > /usr/lib/crt1.o: In function `__start':
> > /usr/lib/crt1.o(.text+0x78): undefined reference to `main'
> > *** Error code 1

> > I've looked at text2pdf.c, and it DOES have a reference to "main"
> > What could be wrong?
> > Help!
> > --
> > Aaron Bentley
> > www.interlog.com/~abentley/music

> --
> A designer  knows  he has achieved perfection  not  when there is
> nothing left to add, but when there is nothing left to take away.
>                                          Antoine de Saint-Exupry
> -----------------------------------------------------------------
> Markus SCHTZ
> 8, Ch. des Aubpines                      Phone: ++41 21 646 9362


>             http://www.geocities.com/SiliconValley/Foothills/9297
> -----------------------------------------------------------------

--
Aaron Bentley
www.interlog.com/~abentley/music
 
 
 

problem compiling library with GCC

Post by Markus Schut » Sun, 31 Jan 1999 04:00:00


Hint:
Try "make" before "make test".
Looks like there is only the link phase that starts, not the compile
phase.
Maybe a "make clean" would help as well.

Markus


> I've been programming on DOS for a while, but I'm pretty new to the unix
> side, "make" etc.
> I'm on a BSDI 4.0 machine.
> I'm trying to use GCC to compile PDFlib,
> http://www.ifconnection.de/~tm/
> I've #defined the POSIX variable that seems to be required for a UNIX
> build.
> I've done "ln -s makefile.gcc makefile" (seems okay)
> and "make test"
> This is the result:
> gcc  -o text2pdf  libpdf.a -lm
> /usr/lib/crt1.o: In function `__start':
> /usr/lib/crt1.o(.text+0x78): undefined reference to `main'
> *** Error code 1

> I've looked at text2pdf.c, and it DOES have a reference to "main"
> What could be wrong?
> Help!
> --
> Aaron Bentley
> www.interlog.com/~abentley/music

--
A designer  knows  he has achieved perfection  not  when there is
nothing left to add, but when there is nothing left to take away.
                                         Antoine de Saint-Exupry
-----------------------------------------------------------------
Markus SCHTZ
8, Ch. des Aubpines                      Phone: ++41 21 646 9362


            http://www.geocities.com/SiliconValley/Foothills/9297
-----------------------------------------------------------------
 
 
 

problem compiling library with GCC

Post by Nic » Mon, 01 Feb 1999 04:00:00



> Ah, that makes more sense.  Now it says
> "make: don't know how to make text2pdf.o. Stop"
> I guess I'll have to read up on makefiles now.  Any suggestions where to look?

Err, just a thought: you may want to try using GNU make. The BSDI make
(is it pmake?) probably doesn't understand GNU make syntax, and will
hence do strange things such as you describe. You may already have it
installed as `gmake', otherwise download it from ftp.gnu.org or
(preferably) a mirror site.

Regards,
        Nic.

-- Nic B. -- email "sky" at "wibble dot net" ------
-- UN*X Programmer, The Internet Group (NZ) Ltd. --
-- #include <stddisclaimer.h> ---------------------