khoren93 / flutter_zxing

Flutter plugin for scanning and generating QR codes using the ZXing library, supporting Android, iOS, and desktop platforms
https://pub.dev/packages/flutter_zxing
MIT License
89 stars 50 forks source link

Windows Compilation Failing #93

Open SimpleTheory opened 1 year ago

SimpleTheory commented 1 year ago

Hey there, thank you for creating this zxing binding for flutter. I tried to include this with my app on Windows but the compilation fails, I have tried everything to debug this including cloning this repo recursively and seeing if windows would compile the example app, but unfortunately it doesn't. In the documentation it says Windows is not supported yet, but in pub.dev and in this repos issues, there are mentions of desktop now working for this project, so I don't know if it is supposed to work or not.

Here are the logs left from the attempted compilation of this project's example app:

D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(78,17): error C2589: '(': illegal token on right side of '::' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(78,1): error C2062: type 'unknown-type' unexpected [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(78,1): error C2059: syntax error: ')' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(79,17): error C2589: '(': illegal token on right side of '::' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(79,1): error C2062: type 'unknown-type' unexpected [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(79,1): error C2059: syntax error: ')' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(80,48): error C2589: '(': illegal token on right side of '::' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(80,1): error C2062: type 'unknown-type' unexpected [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(80,1): error C2059: syntax error: ')' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(81,49): error C2589: '(': illegal token on right side of '::' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(81,1): error C2062: type 'unknown-type' unexpected [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\zxing\core\src\ImageView.h(81,1): error C2059: syntax error: ')' [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(33,45): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(21,9): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(27,9): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(47,10): error C2375: 'setLogEnabled': redefinition; different linkage [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(53,17): error C2375: 'version': redefinition; different linkage [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(60,23): error C2375: 'readBarcode': redefinition; different linkage [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(86,24): error C2375: 'readBarcodes': redefinition; different linkage [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(119,25): error C2375: 'encodeBarcode': redefinition; different linkage [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
D:\StudioProjects\flutter_zxing\example\windows\flutter\ephemeral\.plugin_symlinks\flutter_zxing\src\native_zxing.cpp(136,13): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [D:\StudioProjects\flutter_zxing\example\build\windows\plugins\flutter_zxing\shared\flutter_zxing.vcxproj]
Exception: Build process failed.

Please let me know if the project is supposed to work on desktop and more specifically windows, if so if there are any other limitations like versioning. If it is not supposed to work, I would still like to be able to compile the app and just leave some UnsupportedPlatform widgets whenever a Windows user tries to use the scanner.

Kind Regards, SimpleTheory

Arko109 commented 1 year ago

Same issue here with the same errors, the package is marked as having windows platform, so it should at least compile as the OP mentions

khoren93 commented 10 months ago

Seeking Help with Windows Compilation Issue

Hello,

I'm encountering a compilation problem on Windows and could use some assistance in resolving it. Any guidance or solutions would be greatly appreciated.

Thank you, Khoren