[cs631apue] compile issue
mseaton
mseaton at stevens.edu
Sat Sep 24 20:37:52 EDT 2016
Hello,
Compiling each source file separately(using -c option), each file
including the main one ls.c works fine. Also after compiling all source
files together one one line also works okay, but if I compile ls.c by
itself, I get the following:
undefined reference to `SortFileSize'
ls.c:162: undefined reference to `PrintBlocks'
ls.c:164: undefined reference to `LongFormat'
ls.c:166: undefined reference to `PrintInodeNumber'
These functions are all .c files. I originally had include statements
for each of these files (#include "PrintBlocks.s" for example) inside
ls.c, but I removed them because I have a created header file that has
these prototypes defined. Everything worked when I had these include
files.
Should I put them back in or am I missing something? Also, all the other
.c files has the header files I created.
Marlon
More information about the cs631apue
mailing list