0

This problem is probably common here - anyway - I tried to fix this error on my own, but no result. Actually I don't know if I am missing some framework - because framework list is empty. Anyway, this my first project so I got no idea how to fix this. I checked if I am not missing any ccp. file in compile sources, but all files are there (those with error). So my question is: do I have to add any framework, or is there some problem with these file and put some code in there? And last thing. Soldier , EvilMutant and EvilRobot are ancestor classes and weak, strong and heavy...., are descendant classes.

 Undefined symbols for architecture x86_64:
      "Enemy::EvilMutant::EvilMutant()", referenced from:
          Enemy::WeakMutant::WeakMutant(int) in WeakMutant.o
      "Enemy::Soldier::Soldier()", referenced from:
          Enemy::EasySoldier::EasySoldier(int) in EasySoldier.o
          Enemy::StrongSoldier::StrongSoldier(int, int) in StrongSoldier.o
      "Enemy::EvilRobot::EvilRobot()", referenced from:
          Enemy::SmallRobot::SmallRobot(int) in SmallRobot.o
          Enemy::BigRobot::BigRobot(int, int) in BigRobot.o
          Enemy::HeavyMutant::HeavyMutant(int, int) in HeavyMutant.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • Do you have an implementation of the default constructors of EvilMutant, Soldier, and EvilRobot? My crystal balls says that you have declared those default constructors, but there is no definitions. – lrineau Jan 07 '14 at 13:27
  • Do you use OS X 10.9 Mavericks? Then it could be a way to prevent libstdc++ and libc++ clashes that bites you here. – usr1234567 Jan 07 '14 at 14:26
  • EvilRobot.h con.`EvilRobot();` BigRobot.h con.`BigRobot(int power, int morePower);` and when I put BigRobot.cpp's constructor in comment - theres no error `BigRobot::BigRobot(int power, int morePower) { }` what I did wrong? – user3151945 Jan 07 '14 at 14:58

0 Answers0