Article View: comp.os.msdos.programmer
Article #6272Makefile link order (Help!)
From: Mark Bergman
Date: Mon, 04 Jan 1993 01:01
Date: Mon, 04 Jan 1993 01:01
33 lines
1595 bytes
1595 bytes
I'm pretty clueless about how the order of object files in a makefile
is determined.
For example, I'm trying to "port" (simply recompile) the source to
"agrep" using the DJGPP compiler. I consistently get errors along the
lines of:
preprocess.o: Undefined symbol _init referenced from text segment
^^obj name^^ ^funct^
Where "obj name" and "funct" change depending on the order that the
object files are listed in the makefile. In this case, the function
init() is defined in a module (follow.o) that is listed after
preprocess.o in the makefile. Swithing the two produces more errors of
the same sort, because follow.c depends on functions defined in
preprocess.c.
Defining init() in preprocess.c (either with the same definition found
in follow.c or as an extern) doesn't seem to help--I get the same error
message.
Is there any way to determine the correct order of files in makefile.
Why does it matter, doesn't the linker sort of throw all the functions
into a blender and turn it on?
** Replies via E-mail preferred and quickly acknowledged. **
----
Mark Bergman (Biker, Stagehand, (former) Unix user support grunt)
718-855-9148
bergman@panix.com
{cmcl2,uunet}!panix!bergman
Technical Details
Message-ID:
<C0B1J0.ABn@panix.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!cmcl2!panix!bergmanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!cmcl2!panix!bergman From: bergman@panix.com (Mark Bergman) Newsgroups: comp.os.msdos.programmer,comp.lang.c,alt.msdos.programmer Subject: Makefile link order (Help!) Message-ID: <C0B1J0.ABn@panix.com> Date: 4 Jan 93 01:01:48 GMT Organization: Panix Public Access Internet & Unix, NYC Lines: 33