- Modifié
[UE4] Mac compilation too strict?
I'm having problems building 3.8 on Mac after upgrading from 3.7. It seems like the compiler is stricter on Mac than on Windows (the same code builds successfully there).
[2/7] Compile Module.SpinePlugin.cpp
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:8:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp:235:16: warning: declaration shadows a field of 'USpineSkeletonDataAsset' [-Wshadow]
SkeletonData* skeletonData = nullptr;
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonDataAsset.h:95:23: note: previous declaration is here
spine::SkeletonData* skeletonData;
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:25:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:39:11: error: use of undeclared identifier 'Constraint'; did you mean 'IkConstraint'?
RTTI_IMPL(Constraint, Updatable)
^~~~~~~~~~
IkConstraint
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/RTTI.h:71:19: note: expanded from macro 'RTTI_IMPL'
const spine::RTTI name::rtti(#name, parent::rtti); \
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/Skeleton.h:50:7: note: 'IkConstraint' declared here
class IkConstraint;
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:25:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:39:11: error: use of undeclared identifier 'Constraint'; did you mean 'IkConstraint'?
RTTI_IMPL(Constraint, Updatable)
^~~~~~~~~~
IkConstraint
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/RTTI.h:72:20: note: expanded from macro 'RTTI_IMPL'
const spine::RTTI& name::getRTTI() const { return rtti; }
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/Skeleton.h:50:7: note: 'IkConstraint' declared here
class IkConstraint;
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:25:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:41:1: error: use of undeclared identifier 'Constraint'; did you mean 'IkConstraint'?
Constraint::Constraint() {
^~~~~~~~~~
IkConstraint
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/Skeleton.h:50:7: note: 'IkConstraint' declared here
class IkConstraint;
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:25:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:41:13: error: missing return type for function 'Constraint'; did you mean the constructor name 'IkConstraint'?
Constraint::Constraint() {
^~~~~~~~~~
IkConstraint
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:41:13: error: out-of-line definition of 'IkConstraint' does not match any declaration in 'spine::IkConstraint'
Constraint::Constraint() {
^~~~~~~~~~
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:41:13: error: constructor for 'spine::IkConstraint' must explicitly initialize the reference member '_data'
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/IkConstraint.h:103:20: note: declared here
IkConstraintData &_data;
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:25:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:44:1: error: use of undeclared identifier 'Constraint'; did you mean 'IkConstraint'?
Constraint::~Constraint() {
^~~~~~~~~~
IkConstraint
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/Skeleton.h:50:7: note: 'IkConstraint' declared here
class IkConstraint;
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:25:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:44:14: error: expected the class name after '~' to name a destructor
Constraint::~Constraint() {
^~~~~~~~~~
IkConstraint
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:34:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/IkConstraint.cpp:44:1: error: redefinition of 'rtti'
RTTI_IMPL(IkConstraint, Updatable)
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/RTTI.h:71:25: note: expanded from macro 'RTTI_IMPL'
const spine::RTTI name::rtti(#name, parent::rtti); \
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:39:1: note: previous definition is here
RTTI_IMPL(Constraint, Updatable)
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/RTTI.h:71:25: note: expanded from macro 'RTTI_IMPL'
const spine::RTTI name::rtti(#name, parent::rtti); \
^
In file included from /Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Intermediate/Build/Mac/UE4Editor/Development/SpinePlugin/Module.SpinePlugin.cpp:34:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/IkConstraint.cpp:44:1: error: redefinition of 'getRTTI'
RTTI_IMPL(IkConstraint, Updatable)
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/RTTI.h:72:26: note: expanded from macro 'RTTI_IMPL'
const spine::RTTI& name::getRTTI() const { return rtti; }
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:39:1: note: previous definition is here
RTTI_IMPL(Constraint, Updatable)
^
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/include/spine/RTTI.h:72:26: note: expanded from macro 'RTTI_IMPL'
const spine::RTTI& name::getRTTI() const { return rtti; }
^
1 warning and 10 errors generated.
How do you resolve this? Can I set a compiler flag somewhere? Will that affect deployment to the App Store later on?
It appears you are mixing spine-ue4 from the 3.8 branch with spine-cpp from the 3.7 branch. Please make sure you use spine-ue4 and spine-cpp from the same branch. The simplest way is to just completely smoke the entire Spine UE4 plugins directory in your project, copy over the new version, then regenerate your project files for Xcode/Visual Studio depending on your platform.
I'm fairly sure I'm not. You and I already went through this on github earlier in the week and fixed it. This is pure 3.8 this time.
I normally mirror the project to the Mac with Robocopy from the Windows project. I've been extra careful to delete the Intermediate and Binaries folder, as well as the plugin itself, then mirror the Windows project back to the Mac again. The error persists.
The issue happens when building an additional DLC module that (aside from the code project status) only has blueprints in it but they do reference spine functions. Could that be related? I've tried adding Spine as a module and including the various directories in the module's Build.cs file, but it didn't seem to help.
From your errors:
/Users/justincook/UE4/Projects/PoppyAndBuddy/Plugins/SpinePlugin/Source/SpinePlugin/Public/spine-cpp/src/spine/Constraint.cpp:39:11: error: use of undeclared identifier 'Constraint'; did you mean 'IkConstraint'?
The file spine-cpp/src/spine/Constraint.cpp
is in 3.7:
spine-runtimes/spine-cpp/spine-cpp/src/spine at 3.7
That file is not in 3.8:
spine-runtimes/spine-cpp/spine-cpp/src/spine at 3.8
It is not enough to copy 3.8 on top of 3.7. Please delete all your Spine Runtimes files and replace with a copy from spine-runtimes.
I deleted the plugin and copied in the folder from a new checkout and it still happened.
I figured it out anyway, there was still a Saved directory buried in the DLC module. After that it built fine. So it can be caused by old staged build that doesn't contain the plugin, go figure.
I'm still running into issues with the default plugin content trying to access paper2D textures with incorrect/old paths. Do you want a bug report for this? It's easy to fix but it'd be annoying for every single user to run into it.
Could you elaborate on the incorrect/old paths issue? The spine-ue4 plugin doesn't do anything with Paper2D.
The default texture used in the texture sampler in the Spine materials is a texture in the Paper2D module (in 3.8 and earlier). That's why Spine reports Paper2D as being required if you try to turn Paper2D off.
However the path seems to be incorrect now as well, so you have to open the materials, wait for them to finish hanging and then replace it.
The Spine plugin does not depend on Paper2D though. It only depends on ProceduralMeshComponent
, UMG
, Slate
, and SlateCore
.
spine-runtimes/SpinePlugin.uplugin at 3.8
spine-runtimes/SpinePlugin.Build.cs at 3.8
Could you show me the error you get when you try to turn offPaper2D? I'm having trouble reproducing this.