[EMAIL PROTECTED] wrote:
> I am using gcc 4.0  with Xcode 2.2 on Mac OS 10.4.3.
> I am using two static lib's in my project, which in turn include zlib.
> I get "multiple definition of symbol"  Linker error.

No you don't, it also tells you which symbols and where. In C++ you have a
so-called one definition rule (ODR) which seems to be what you have broken
with your program.

> While using msvc 7.0 linker flag "/FORCE:MULTIPLE" eliminates this
> error.

Doing so is the equivalent of performing a brute force C-style cast - the
compiler is completely at the mercy of the programmer, it can't perform
any error checks and if it breaks nothing can be done. I haven't come
across a case where using this flag was a proper fix.0

> Is there a similar flag for gcc?

You could write a linker script or provide some linker flags, but I suggest
fixing the problem and not tampering with the symptoms.

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/

_______________________________________________
Help-gplusplus mailing list
Help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to