www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/20/04:14:55

Date: Mon, 20 Jul 1998 11:13:27 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Richard Lanyon <rlanyon AT plato DOT wadham DOT ox DOT ac DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Undefined reference to `main'
In-Reply-To: <Pine.LNX.3.95.980719173548.17348A-100000@plato.wadham.ox.ac.uk>
Message-ID: <Pine.SUN.3.91.980720111258.3059B-100000@is>
MIME-Version: 1.0

On Sun, 19 Jul 1998, Richard Lanyon wrote:

> > What was the exact GCC command used to compile dsweep.o?
> 
> gcc -Wall -c dsweep.c

But this is a C++ program, right?  (I assume this because you linked
it with -lgpp.)  If so, you should call the source file dsweep.cc or
dsweep.cpp, otherwise GCC will compile it as a C program, and that
could very well result in unresolved externals.

> i) how do I link to libraries if they aren't called lib??.o (or lib??.so).
> Can I just rename them

You just mention the library names on the link command line, as if
they were object files (but put them after all the object files).

> (they're libraries compiled using Borland Turbo
> Pascal 2.0)? 

This is in general impossible.  You cannot link DJGPP programs with
libraries or object files produced by other compilers.

> ii) why is make behaving so strangely?

I wasn't even aware that Make is part of this equation, since you
never mentioned it.  The only reason I could think of is that you used
backslashes, and Make treats those as escape characters.  Use forward
slashes instead.

If that doesn't help, you will have to tell more about the differences
between invocation from the command-line and from Make.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019