Warning: size of symbol `Foo::bar()' changed from 102 in ./Foo.o to 104 in Baz.o

From Cppsyntax

Jump to: navigation, search

Warnings that look like

 Warning: size of symbol `Foo::bar()' changed from 102 in ./Foo.o to 104 in Baz.o

are dangerous. They mean that you have declared Foo::bar() twice -- once in Foo and once in Baz.

This can happen if you type the wrong name in the class spot, as below:

WRONG

Foo.cc

 #include "foo.h"
 int Foo::wacka() { // stuff }
 int Foo::bar() {
   // stuff
 }
 int Foo::otherMethod() { // stuff }

Baz.cc

 #include "baz.h"
 int Baz::crumpets() { // stuff }
 int Foo::bar() {                     // typo!  this should be Baz::bar()!
   // stuff
 }
 int Baz::evenMoreStuff() { // stuff }

RIGHT

Foo.cc

 #include "foo.h"
 int Foo::wacka() { // stuff }
 int Foo::bar() {
   // stuff
 }
 int Foo::otherMethod() { // stuff }

Baz.cc

 #include "baz.h"
 int Baz::crumpets() { // stuff }
 int Baz::bar() {                     // typo!  this should be Baz::bar()!
   // stuff
 }
 int Baz::evenMoreStuff() { // stuff }
Personal tools