In one of my header (C++) files I changed
#define TIMEOUT 10
to the more(?) C++ way:
const int TIMEOUT = 10;
It seems however, g++(v 4.4.3) now includes this symbol several times in the binary.
$ nm -C build/ipd/ipd |head
08050420 T ToUnixTime
08050470 T ParseTime
080504c0 T ParseISOTime
080518e4 r TIMEOUT
080518ec r TIMEOUT
080518f4 r TIMEOUT
080518fc r TIMEOUT
080503e0 T HandleMessage
How come ?
You have probably included your header in four separate translation units (.cpp files).
Namespace-scope const variables not declared extern are implicitly static, so there will be one for each translation unit in which the header is included.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With