• Runtimes
  • spine-cocos2dx-example compile error

I've discovered that there are two identical header files named SkeletonRenderer.h, located in different directories. One is in the spine-cocos2dx\spine-cocos2dx\src\spine folder, and the other is in the spine-cpp\spine-cpp\include\spine folder. Both header files declare a SkeletonRenderer class, but their declarations are entirely different. This discrepancy has led to a significant issue in the spine-cocos2dx project where the subclass SkeletonAnimation of SkeletonRenderer mistakenly references the wrong base class, resulting in numerous compilation errors. Additionally, some of the compilation errors arise from the cocos2dx code itself. However, the project compiled successfully before the spine-runtimes were included. I also tried compiling the spine-cocos2dx-example project and encountered the exact same compilation errors.

Related Discussions
...

It seems like the issue you're encountering is due to conflicting SkeletonRenderer.h files from different directories. Here are some steps to resolve this:

  1. Ensure Correct Include Paths: Make sure that your project is including the correct SkeletonRenderer.h file. The one that should be used is from the spine-cocos2dx directory, not the spine-cpp directory. Adjust your include paths accordingly.

  2. Clean Build: Perform a clean build of your project. Sometimes, old compiled files can cause conflicts. Delete all the build artifacts and recompile the project from scratch.

  3. Update to Latest Runtimes: Ensure you are using the latest versions of the Spine runtimes. The spine-cocos2dx runtime should be up-to-date. You can find the latest versions on the Spine runtimes GitHub repository.

  4. Check Example Project Configuration: Refer to the example project provided in the spine-cocos2dx runtime. Ensure that your project configuration matches the example, especially the include paths and linked libraries.

  5. Remove Redundant Files: If you have both spine-cpp and spine-cocos2dx in your project, consider removing the spine-cpp files if they are not needed. This will prevent any conflicts between the two.

Here is a summary of the steps:

  • Ensure the correct SkeletonRenderer.h file is included.
  • Perform a clean build.
  • Update to the latest Spine runtimes.
  • Match your project configuration with the example project.
  • Remove redundant files to avoid conflicts.

By following these steps, you should be able to resolve the compilation errors and successfully compile the spine-cocos2dx project.

Ahh, that's a collision between two separate implementations. The cocos2d-x compilation errors are a known problem of cocos2d-x itself, which is no longer maintained. There's not a lot we can do about that I'm afraid, apart from forking their repository, fixing the errors, and pointing our users to our fork. We don't have the resources for that.

As for the compilation error due to SkeletonRenderer.h I'll try to fix that asap.