Skip to content

MINGW: Fix error of use of deleted function#593

Open
carlo-bramini wants to merge 1 commit intoluciusDXL:masterfrom
carlo-bramini:fix-mingw-build
Open

MINGW: Fix error of use of deleted function#593
carlo-bramini wants to merge 1 commit intoluciusDXL:masterfrom
carlo-bramini:fix-mingw-build

Conversation

@carlo-bramini
Copy link

I tried to build the engine with MinGW and I got several errors like this one:

TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:29:43: error: use of deleted function ‘std::atomic<int>::atomic(const std::atomic<int>&)’
   29 |         std::atomic<s32> s_requestCount = 0;
      |                                           ^
In file included from TheForceEngine/TFE_System/types.h:6,
                 from TheForceEngine/TFE_System/system.h:8,
                 from TheForceEngine/TFE_FileSystem/filewriterAsync.h:2,
                 from TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:1:
/usr/lib/gcc/x86_64-w64-mingw32/14/include/c++/atomic:834:7: note: declared here
  834 |       atomic(const atomic&) = delete;
      |       ^~~~~~
TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:29:43: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
   29 |         std::atomic<s32> s_requestCount = 0;
      |                                           ^
/usr/lib/gcc/x86_64-w64-mingw32/14/include/c++/atomic:838:17: note:   after user-defined conversion: ‘constexpr std::atomic<int>::atomic(__integral_type)’
  838 |       constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
      |                 ^~~~~~

Attached patch fixes it.
Actually, this file doesn't seem to be compiled by the Visual Studio project file, so I could not test if this change works there too. However, I have been able to build the engine also with MSVC even after this fix.

I tried to build the engine with MinGW and I got several errors like this one:

TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:29:43: error: use of deleted function ‘std::atomic<int>::atomic(const std::atomic<int>&)’
   29 |         std::atomic<s32> s_requestCount = 0;
      |                                           ^
In file included from TheForceEngine/TFE_System/types.h:6,
                 from TheForceEngine/TFE_System/system.h:8,
                 from TheForceEngine/TFE_FileSystem/filewriterAsync.h:2,
                 from TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:1:
/usr/lib/gcc/x86_64-w64-mingw32/14/include/c++/atomic:834:7: note: declared here
  834 |       atomic(const atomic&) = delete;
      |       ^~~~~~
TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:29:43: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
   29 |         std::atomic<s32> s_requestCount = 0;
      |                                           ^
/usr/lib/gcc/x86_64-w64-mingw32/14/include/c++/atomic:838:17: note:   after user-defined conversion: ‘constexpr std::atomic<int>::atomic(__integral_type)’
  838 |       constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
      |                 ^~~~~~

Attached patch fixes it.
Actually, this file doesn't seem to be compiled by the Visual Studio project file, so I could not test if this change works there too.
However, I have been able to build the engine also with MSVC even after this fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments