GodotECS / godex

Godex is a Godot Engine ECS library.
MIT License
1.2k stars 68 forks source link

Resolving Compile/Linker Error: ODR issue with 'Dependency' class/struct #298

Closed TDCRanila closed 2 years ago

TDCRanila commented 2 years ago

Hello There.

As it seems, the current build will not compile for me - Windows MSVC with debug and release_debug configurations. Godex Commit: 1d2e23a42ed57e3017f3efb6a8fafc8912141b08 Godot Commit: https://github.com/godotengine/godot/commit/667cef39b4e9f98ed545d95de442319c447f2164

[ 73%] Linking Static Library servers\servers.windows.opt.tools.64.lib ...
... godot.vsproj configuration setup...
[ 96%] progress_finish(["progress_finish"], [])
[100%] Linking Static Library modules\module_gdscript.windows.opt.tools.64.lib ...
[100%] Linking Static Library core\core.windows.opt.tools.64.lib ...
[100%] Linking Program bin\godot.windows.opt.tools.64.exe ...

servers.windows.opt.tools.64.lib(utilities.windows.opt.tools.64.obj) : error LNK2005: "public: __cdecl Dependency::~Dependency(void)" (??1Dependency@@QEAA@XZ) already defined in module_godex.windows.opt.tools.64.lib(ecs.windows.opt.tools.64.obj)
   Creating library bin\godot.windows.opt.tools.64.lib and object bin\godot.windows.opt.tools.64.exp
bin\godot.windows.opt.tools.64.exe : fatal error LNK1169: one or more multiply defined symbols found

scons: *** [bin\godot.windows.opt.tools.64.exe] Error 1169
scons: building terminated because of errors.
[Time elapsed: 00:34:11.568]

My commit(https://github.com/TDCRanila/godex/commit/a1df1c6b07bbc1540271d024b9698857aee01655) simply renames the 'Dependency' class to 'SystemDependency' to resolve the issue. :) (Putting 'Dependency' in the 'godex' namespace would also work fine and avoid future conflicts if that is preferable.)

AndreaCatania commented 2 years ago

It looks nice thx!