MINGW: Fix error of use of deleted function - #593
Conversation
|
While your fix is in principle correct, the file itself is unused. index 31a3df93..c91698be 100644
--- a/TheForceEngine/TFE_FileSystem/CMakeLists.txt
+++ b/TheForceEngine/TFE_FileSystem/CMakeLists.txt
@@ -12,7 +12,6 @@ elseif(UNIX)
)
endif()
target_sources(tfe PRIVATE
- "${CMAKE_CURRENT_SOURCE_DIR}/filewriterAsync.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/memorystream.cpp"
)
|
|
Thank you for the reply. EDIT: I did a test and I confirm that your solution also fixed the original issue. |
jerethk
left a comment
There was a problem hiding this comment.
mlauss2 is correct, this file is not currently used by TFE.
However, the fix is appropriate and IMO worthwhile in case the file ever gets used in the future.
Feel free to also add a commit removing it from CMakelists.txt, if you wish. I am happy to approve for now.
|
carlo-bramini by the way, as I understand it, the preferred syntax is
If you are going to add the change to CMakeLists.txt do you want to also make this change? |
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.
1e61ef9 to
883c866
Compare
I did the changes. |
I tried to build the engine with MinGW and I got several errors like this one:
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.