I'm making a game in C++ but I get these errors that I don't know how to fix.
G:\SpaceCombat\SpaceCombatMain.o(.text$_ZN6ObjectC1Ev+0x5)
[Warning] In function `ZN10MenuObject9BeginPlayEv':
[Linker error] undefined reference to `Object::NumberOfObjects'
[Linker error] undefined reference to `Object::NumberOfObjects'
[Linker error] undefined reference to `Object::NumberOfObjects'
[Linker error] undefined reference to `Scene::SceneN'
[Linker error] undefined reference to `Scene::SceneN'
[Linker error] undefined reference to `Scene::SceneN'
The compile log shows
SpaceCombatMain.o(.text$_ZN6ObjectC1Ev+0x5): In function `ZN10MenuObject9BeginPlayEv':
G:/SpaceCombat/LevelFile.h: undefined reference to `Object::NumberOfObjects'
SpaceCombatMain.o(.text$_ZN6ObjectC1Ev+0xd):G:/SpaceCombat/LevelFile.h: undefined reference to `Object::NumberOfObjects'
SpaceCombatMain.o(.text$_ZN6ObjectD1Ev+0x5):G:/SpaceCombat/LevelFile.h: undefined reference to `Object::NumberOfObjects'
SpaceCombatMain.o(.text$_ZN5SceneC1Ev+0x5):G:/SpaceCombat/LevelFile.h: undefined reference to `Scene::SceneN'
SpaceCombatMain.o(.text$_ZN5SceneC1Ev+0xd):G:/SpaceCombat/LevelFile.h: undefined reference to `Scene::SceneN'
SpaceCombatMain.o(.text$_ZN5SceneD1Ev+0x5):G:/SpaceCombat/LevelFile.h: undefined reference to `Scene::SceneN'
2006-08-01
17:50:32
·
2 answers
·
asked by
DukeInstinct
2
in
Computers & Internet
➔ Programming & Design
Object::NoOfObjects is a static int
Scene::SceneN is also a static int
2006-08-01
18:17:40 ·
update #1