C/C++

[SOLVED - BUG] g++ strange "errors"

2 3005
AlterX  
Edited by AlterX at Fri Jan 16, 2015 07:43

Hello all,
I am trying to compile a mine library on the lastest banian version (v. 15.x). Same code compiles well on linux, android, blackberry, iphone and macosx.
Here is the result:
g++ -fPIC -O2 -shared -DLINUX -Wl,-soname,libSolomon_v2.so -ldl -lpthread -I./ *.cpp -o /home/libSolomon_v2.so

AbstractTcpServerGame.cpp: In function âvoid* StartTcpSupportedServer(void*)â:
AbstractTcpServerGame.cpp:143:54: warning: passing NULL to non-pointer argument 2 of âTInfoConn::TInfoConn(in_addr_t, integer)â [-Wconversion-null]
CSocket.cpp: In static member function âstatic integer CSocket::SendTcpSegment(sock, buffer_pointer, size_t)â:
CSocket.cpp:226:24: warning: unknown escape sequence: '\-' [enabled by default]
In file included from GameClientClass.h:19:0,
                 from GameClientClass.cpp:12:
Solomon.h:43:0: warning: "FALSE" redefined [enabled by default]
GameClientClass.h:16:0: note: this is the location of the previous definition
In file included from GameServerClass.h:21:0,
                 from GameServerClass.cpp:13:
Solomon.h:43:0: warning: "FALSE" redefined [enabled by default]
GameServerClass.h:18:0: note: this is the location of the previous definition
/tmp/ccsWFlcF.o(.data.rel.ro+0x30): multiple definition of `typeinfo for Solomon::Types::IBaseType<unsigned short>'
/tmp/cc0bVzgv.o(.data.rel.ro+0x14): first defined here
/tmp/ccsWFlcF.o(.data.rel.ro+0x38): multiple definition of `typeinfo for Solomon::Types::IBaseType<short>'
/tmp/cc0bVzgv.o(.data.rel.ro+0x1c): first defined here
/tmp/ccsWFlcF.o(.data.rel.ro+0x40): multiple definition of `typeinfo for Solomon::Types::IBaseType<unsigned long>'
/tmp/cc0bVzgv.o(.data.rel.ro+0x24): first defined here
/tmp/ccsWFlcF.o(.data.rel.ro+0x48): multiple definition of `typeinfo for Solomon::Types::IBaseType<unsigned int>'
/tmp/cc0bVzgv.o(.data.rel.ro+0x2c): first defined here
/tmp/ccsWFlcF.o(.data.rel.ro+0x50): multiple definition of `typeinfo for Solomon::Types::IBaseType<int>'
/tmp/cc0bVzgv.o(.data.rel.ro+0x34): first defined here
/tmp/ccsWFlcF.o.data.rel.ro+0x58): multiple definition of `typeinfo for Solomon::Types::IBaseType<float>'
/tmp/cc0bVzgv.o.data.rel.ro+0x3c): first defined here
/tmp/ccsWFlcF.o.data.rel.ro+0x60): multiple definition of `typeinfo for Solomon::Types::IBaseType<unsigned char>'
/tmp/cc0bVzgv.o.data.rel.ro+0x44): first defined here
/tmp/ccsWFlcF.o.rodata+0x24): multiple definition of `typeinfo name for Solomon::Types::IBaseType<unsigned short>'
/tmp/cc0bVzgv.o.rodata+0x15c): first defined here
/tmp/ccsWFlcF.o.rodata+0x44): multiple definition of `typeinfo name for Solomon::Types::IBaseType<short>'
/tmp/cc0bVzgv.o.rodata+0x17c): first defined here
/tmp/ccsWFlcF.o.rodata+0x64): multiple definition of `typeinfo name for Solomon::Types::IBaseType<unsigned long>'
/tmp/cc0bVzgv.o.rodata+0x19c): first defined here
/tmp/ccsWFlcF.o:(.rodata+0x84): multiple definition of `typeinfo name for Solomon::Types::IBaseType<unsigned int>'
/tmp/cc0bVzgv.o:(.rodata+0x1bc): first defined here
/tmp/ccsWFlcF.o:(.rodata+0xa4): multiple definition of `typeinfo name for Solomon::Types::IBaseType<int>'
/tmp/cc0bVzgv.o:(.rodata+0x1dc): first defined here
/tmp/ccsWFlcF.o:(.rodata+0xc4): multiple definition of `typeinfo name for Solomon::Types::IBaseType<float>'
/tmp/cc0bVzgv.o:(.rodata+0x1fc): first defined here
/tmp/ccsWFlcF.o:(.rodata+0xe4): multiple definition of `typeinfo name for Solomon::Types::IBaseType<unsigned char>'
/tmp/cc0bVzgv.o:(.rodata+0x21c): first defined here
collect2: ld returned 1 exit status

I don't understand what the error can be since there is no "real" error message.

Thanks
AlterX  
According to this post: https://sourceware.org/bugzilla/show_bug.cgi?id=12762
I found a workaround that solved problem: passing -allow-multiple-definition to the linker.
I think this is a bug in this version of g++ on bananian/debian

Thanks@AlterX!
Visit clicker heroes 2.0 free online game.

You have to log in before you can reply Login | Sign Up

Points Rules