jeudi 29 octobre 2015

How to avoid multiple definition of object declared in .h file of C++ [duplicate]

This question already has an answer here:

I have a GameUI.h, Round1.cpp and GameUI.cpp file.

In GameUI.h, I have declared:

static cocos2d::sprite* battery;

Both Round1.cpp and GameUI.cpp has included GameUI.h and this is creating multiple definition problem and giving

linker command failed with exit code 1 - Error

Aucun commentaire:

Enregistrer un commentaire