Trouble with modules

Deewiant deewiant.doesnotlike.spam at gmail.com
Sat Apr 15 10:42:55 PDT 2006


Andrew Madigan wrote:
> Allright, now I'm getting a related error, there are two functions defined
> in HttpCommon.d (they're global). I'm getting errors about multiple
> definition. What should I do?
> 
> gdc HttpCommon.d  -o http Application.o HttpCommon.o http.o
> InterruptableThread.o Request.o RequestThread.o RootApplication
> .o StatusCode.o TestApp.o WebServer.o
> HttpCommon.o: In function
> `_D10HttpCommon10HttpCommon15getProtocolNameFE10HttpCommon8ProtocolZAa
> ':HttpCommon.d:(.text+0x0):
>  multiple definition of
> `_D10HttpCommon10HttpCommon15getProtocolNameFE10HttpCommon8ProtocolZAa'
> /tmp/cccBIwTr.o:HttpCommon.d:(.text+0x0): first defined here
> HttpCommon.o: In function
> `_D10HttpCommon10HttpCommon17getProtocolByNameFAaZE10HttpCommon8Protocol
> ':HttpCommon.d:(.text+0x5
> e): multiple definition of
> `_D10HttpCommon10HttpCommon17getProtocolByNameFAaZE10HttpCommon8Protocol'
> /tmp/cccBIwTr.o:HttpCommon.d:(.text+0x5e): first defined here
> HttpCommon.o:(.rodata+0x14): multiple definition of
> `_init_10HttpCommon10HttpCommon'
> /tmp/cccBIwTr.o:(.rodata+0x14): first defined here
> HttpCommon.o:(.rodata+0x28): multiple definition of
> `_vtbl_10HttpCommon10HttpCommon'
> /tmp/cccBIwTr.o:(.rodata+0x28): first defined here
> HttpCommon.o:(.data+0x0): multiple definition of
> `_Class_10HttpCommon10HttpCommon'
> /tmp/cccBIwTr.o:(.data+0x0): first defined here
> collect2: ld returned 1 exit status
> make: *** [http] Error 1
> 

It seems like you're compiling both HttpCommon.d and HttpCommon.o, and that
they're conflicting with each other.



More information about the Digitalmars-d-learn mailing list