I created a new flutter project and tried to run it as a desktop application (on windows) , however I got the following error :
<code>C:UsersmuhamStudioProjectsuntitledwindowsrunnerutils.cpp(54,43): error C2220: warning treated as error - no 'object' file generated [C:UsersmuhamStudioProjectsuntitledbuildwindowsrunneruntitled.vcxproj]
C:UsersmuhamStudioProjectsuntitledwindowsrunnerutils.cpp(54,43): warning C4018: '>': signed/unsigned mismatch [C:UsersmuhamStudioProjectsuntitledbuildwindowsrunneruntitled.vcxproj]
Exception: Build process failed.
</code>
<code>C:UsersmuhamStudioProjectsuntitledwindowsrunnerutils.cpp(54,43): error C2220: warning treated as error - no 'object' file generated [C:UsersmuhamStudioProjectsuntitledbuildwindowsrunneruntitled.vcxproj]
C:UsersmuhamStudioProjectsuntitledwindowsrunnerutils.cpp(54,43): warning C4018: '>': signed/unsigned mismatch [C:UsersmuhamStudioProjectsuntitledbuildwindowsrunneruntitled.vcxproj]
Exception: Build process failed.
</code>
C:UsersmuhamStudioProjectsuntitledwindowsrunnerutils.cpp(54,43): error C2220: warning treated as error - no 'object' file generated [C:UsersmuhamStudioProjectsuntitledbuildwindowsrunneruntitled.vcxproj]
C:UsersmuhamStudioProjectsuntitledwindowsrunnerutils.cpp(54,43): warning C4018: '>': signed/unsigned mismatch [C:UsersmuhamStudioProjectsuntitledbuildwindowsrunneruntitled.vcxproj]
Exception: Build process failed.
I tried to disable the warning treated as error
by changing the following line in the CmakeList.txt file :
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd”4100″)
I tried to delete the /WX and convert it to /WX- , both did not work,
also I tried to fix the > match/mismatch error
by changing the following line in the utils.cpp from
<code>if (target_length <= 0 || target_length > utf8_string.max_size()) {
</code>
<code>if (target_length <= 0 || target_length > utf8_string.max_size()) {
</code>
if (target_length <= 0 || target_length > utf8_string.max_size()) {
to
<code>if (target_length <= 0 || static_cast<size_t>(target_length) > utf8_string.max_size()) {
</code>
<code>if (target_length <= 0 || static_cast<size_t>(target_length) > utf8_string.max_size()) {
</code>
if (target_length <= 0 || static_cast<size_t>(target_length) > utf8_string.max_size()) {
but also did not work,
any ideas about how can I solve this ?