Skip to content

Signed/Unsigned mismatch warning in Windows template utils.cpp #134227

@muhammadmnyer

Description

@muhammadmnyer

I tried to run my flutter project on windows device and I got the following error :

C:\Users\hazem\StudioProjects\windows_testing\windows\runner\utils.cpp(54,43): error C2220: warning treated as error - no 'object' file generated [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] C:\Users\hazem\StudioProjects\windows_testing\windows\runner\utils.cpp(54,43): warning C4018: '>': signed/unsigned mismatch [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] Exception: Build process failed.

after searcing I found that the C2220 error occurs when a warning is treated as an error so I tried to build this c++ file to find if there is any errors or warnings and this is what I found :

fatal error: flutter_windows.h: No such file or directory

so I looked at the runner folder and I found a header file named flutter_window.h .
The file name does not Contain s it's just window so I tried to remove the s in the include command amd it became :

#include <flutter_window.h>

and the error became :

C:\Users\hazem\StudioProjects\windows_testing\windows\runner\utils.cpp(3,10): error C1083: Cannot open include file: 'flutter_window.h': No such file or directory [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] Exception: Build process failed.

finally I tried to add the s in the file name and in the include command and the error became :

C:\Users\hazem\StudioProjects\windows_testing\windows\runner\flutter_window.cpp(1,10): error C1083: Cannot open include file: 'flutter_window.h': No such file or directory [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] C:\Users\hazem\StudioProjects\windows_testing\windows\runner\main.cpp(5,10): error C1083: Cannot open include file: 'flutter_window.h': No such file or directory [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] C:\Users\hazem\StudioProjects\windows_testing\windows\runner\utils.cpp(54,43): error C2220: warning treated as error - no 'object' file generated [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] C:\Users\hazem\StudioProjects\windows_testing\windows\runner\utils.cpp(54,43): warning C4018: '>': signed/unsigned mismatch [C:\Users\hazem\StudioProjects\windows_testing\build\windows\runner\windows_testing.vcxproj] Exception: Build process failed.

Any ideas how can I solve this problem ?
Appreciate your help .

Metadata

Metadata

Assignees

Labels

Bot is counting down the days until it unassigns the issueP2Important issues not at the top of the work listplatform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions