After some years I decided to return back to this and try emscripten once again. Long story short I still had build errors but I consider it as progress nonetheless.
This error however is of the compiler complaining of redefinition of classes and I am confused why it should be so.
Setup:
os: win10
Emscripten SDK: v2.0.4
Urho3D version: current master as at time of reporting https://github.com/urho3d/Urho3D/tree/ebd7633f8916149212159d4a1cccfe1ac70c1da5
Error output:
[ 76%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/Model.cpp.o
[ 77%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/OcclusionBuffer.cpp.o
[ 77%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/Octree.cpp.o
[ 77%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/OctreeQuery.cpp.o
[ 77%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/OpenGL/OGLConstantBuffer.cpp.o
[ 77%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/OpenGL/OGLGraphics.cpp.o
In file included from C:\urho3d\urho3d_git\Source\Urho3D\Graphics\OpenGL\OGLGraphics.cpp:56:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/Input.h:27:
C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/FlagSet.h:46:7: error: redefinition of ‘FlagSet’
class FlagSet
^
C:\urho3d\urho3d_git\Source\Urho3D\Graphics\OpenGL/…/…/Graphics/…/Container/FlagSet.h:46:7: note: previous definition is here
class FlagSet
^
In file included from C:\urho3d\urho3d_git\Source\Urho3D\Graphics\OpenGL\OGLGraphics.cpp:56:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/Input.h:28:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/HashSet.h:25:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/…/Container/HashBase.h:31:
C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/…/Container/Allocator.h:40:8: error: redefinition of ‘AllocatorBlock’
struct AllocatorBlock
^
C:/urho3d\urho3d_git\Source\Urho3D\Container/…/Container/Allocator.h:40:8: note: previous definition is here
struct AllocatorBlock
^
In file included from C:\urho3d\urho3d_git\Source\Urho3D\Graphics\OpenGL\OGLGraphics.cpp:56:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/Input.h:28:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/HashSet.h:25:
In file included from C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/…/Container/HashBase.h:31:
C:/urho3d/urho3d_git/web2/include/Urho3D/ThirdParty…/Input/…/Container/…/Container/Allocator.h:54:8: error: redefinition of ‘AllocatorNode’
struct AllocatorNode
^
C:/urho3d\urho3d_git\Source\Urho3D\Container/…/Container/Allocator.h:54:8: note: previous definition is here
struct AllocatorNode
Just to be sure nothing is wrong with the source files ( which I am assure I didn’t touch any code in it) I had to build for windows platform using mingw and everything built well.
From the little I could investigate, it turned out that the compiler was referencing two different sets of header files; one in {urho3d-dir}/{build-folder}/include and the other header files in the same folder as their respective source file in ${urho3d-dir}/Source/Urho3D.
I would really appreciate any assistance here to help me resolve this.
Thanks