duplicate symbol _OBJC_METACLASS_$_ClassName

前端 未结 18 1919
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 15:10

I am trying to run my cocos2d application and facing this error, as I have recently upgraded my sdk to 4.2 and my cocos2d to 0.99.5.

I tried to clean my project even

相关标签:
18条回答
  • 2020-12-15 15:54

    You are linking the file MenuScene.m twice. You apparently have it in a static library and also in your main application.

    0 讨论(0)
  • 2020-12-15 15:54

    Another rather simple thing to check is that you did not accidentally #import a .m file instead of a .h header file.

    Happened to me.

    0 讨论(0)
  • 2020-12-15 15:57

    I have also had this particular error occur when a file that has not been added to the project, is referenced somewhere in the project. The two cases where I have experienced this are where I have deleted/removed files from the project without removing references to them, and when working cooperatively on a project where a teammate added the reference but I have not added the file to my version of the project.

    I know the OP has resolved their problem, but I felt this might help someone else who reads this question while looking for help.

    0 讨论(0)
  • 2020-12-15 15:58

    Another possibility for error like this is when there is a class name collision. Either 2 classes with the same name within your project, or class from your project clashing with one defined in some of dependency libraries.

    0 讨论(0)
  • 2020-12-15 15:58

    Remove target from right panel and again add target. This will remove any duplicate references. It may happen if 2 programmer add the same target and commit the project file.

    0 讨论(0)
  • 2020-12-15 15:58

    In my case I was using a binary library includes the same class name I was using outside, So I changed my class name and It's working fine :)

    0 讨论(0)
提交回复
热议问题