Re: How to do intremental linking with gcc and ld

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bryan Christ wrote:

>  gcc -c $(CFLAGS) $(INCLUDES) $(DEFS) *.c
>  ld -r -o common_tools.o *.o
> 
> And here is how I try to link against the common object file:
> 
> gcc -c $(CFLAGS) $(INCLUDES) $(LIBS) $(NORMAL_DEFS) *.c
> ld -o myprogram *.o ../../common/common_tools.o
> 
> I'm sure I'm missing something trivial but don't know what that is.

Your final link must take care of the library references.  You could
substitute gcc for ld at that stage.  The .o which you made by ld -r is
just like any other .o.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux