The instanciation of the template VgjsCoroPromise for void causes Link errors when the header is included from multiple modules:
1>LINK : H:\Dev\GameTemplate\\x64\Debug\Skull8.exe not found or not built by the last incremental link; performing full link 1>Settings.ixx.obj : error LNK2005: "public: class vgjs::VgjsCoroReturn<void> __cdecl vgjs::VgjsCoroPromise<void>::get_return_object(void)" (?get_return_object@?$VgjsCoroPromise@X@vgjs@@QEAA?AV?$VgjsCoroReturn@X@2@XZ) already defined in main.obj 1>SoundResources.ixx.obj : error LNK2005: "public: class vgjs::VgjsCoroReturn<void> __cdecl vgjs::VgjsCoroPromise<void>::get_return_object(void)" (?get_return_object@?$VgjsCoroPromise@X@vgjs@@QEAA?AV?$VgjsCoroReturn@X@2@XZ) already defined in main.obj 1>H:\Dev\GameTemplate\\x64\Debug\Skull8.exe : fatal error LNK1169: one or more multiply defined symbols found
Commenting the following instanciation solves the linking issue:
auto VgjsCoroPromise<void>::get_return_object() noexcept -> VgjsCoroReturn<void> { return { std::coroutine_handle<VgjsCoroPromise<void>>::from_promise(*this) }; };
The instanciation of the template VgjsCoroPromise for void causes Link errors when the header is included from multiple modules:
1>LINK : H:\Dev\GameTemplate\\x64\Debug\Skull8.exe not found or not built by the last incremental link; performing full link 1>Settings.ixx.obj : error LNK2005: "public: class vgjs::VgjsCoroReturn<void> __cdecl vgjs::VgjsCoroPromise<void>::get_return_object(void)" (?get_return_object@?$VgjsCoroPromise@X@vgjs@@QEAA?AV?$VgjsCoroReturn@X@2@XZ) already defined in main.obj 1>SoundResources.ixx.obj : error LNK2005: "public: class vgjs::VgjsCoroReturn<void> __cdecl vgjs::VgjsCoroPromise<void>::get_return_object(void)" (?get_return_object@?$VgjsCoroPromise@X@vgjs@@QEAA?AV?$VgjsCoroReturn@X@2@XZ) already defined in main.obj 1>H:\Dev\GameTemplate\\x64\Debug\Skull8.exe : fatal error LNK1169: one or more multiply defined symbols foundCommenting the following instanciation solves the linking issue:
auto VgjsCoroPromise<void>::get_return_object() noexcept -> VgjsCoroReturn<void> { return { std::coroutine_handle<VgjsCoroPromise<void>>::from_promise(*this) }; };