Compiler error: multiple definition of `gnu_dev_makedev'
Posted on 2010-11-08
I'm trying to port my app (a function library) over to Oracle Linux. It's a bunch of .c files which are compiled into a bunch of .o files, then I have a small test program which calls into one of the routines. But I get a ton of errors of the form:
multiple definition of `gnu_dev_makedev'
also for `gnu_dev_minor' and `gnu_dev_major'
over and over for functions in many of my .c files. Then it ends with
ld returned 1 exit status
I'm getting spotty info on this online and no good solutions. it sounds like this is some builtin function or macro multiply defined, though I also don't see why it's not a warning instead of an error. I've tried this with cc and gcc and there's no apparent difference.
My compile line for the .o is:
cc -c mycfile.c -I$TOPS -fPIC -shared
(TOPS is where my files are)
and for the main program is:
cc testctd.c *.o -lm