duplicate symbol linker errors, my fault or D's?

Jonathan M Davis jmdavisProg at gmx.com
Mon Mar 5 17:21:12 PST 2012


On Tuesday, March 06, 2012 01:53:02 Zach the Mystic wrote:
> Reading the documentation about compiler options and flags here:
> http://dlang.org/dmd-osx.html
> 
> led me to believe that building libraries was the right way to do
> incremental compilation. But I thought, well, can I just build
> file1.o object files instead?
> 
> So I've started doing that and I've got no problems so far. I
> guess I don't need all that fancy .lib and -L-lmyLib stuff after
> all. You can pack all sorts of stuff into a file1.o file instead.
> 
> I guess I solved my problem for now. Hopefully I'm making sense.

Libraries are not intented for incremental compilation. They are for 
distributing code in a unit which can be used by programs. And in the case of 
a shared library, it gives the added benefit of reducing the amount of 
duplicate code you get in binaries (saving both memory and disk space).

If you want to do incremental compilation, then use -c to generate object files 
that you link together when you create the actual executable.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list