home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.msdos.programmer:11771 comp.lang.c:19161 alt.msdos.programmer:3080
- Path: 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
-
- 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
-