ftylitak / qzxing

Qt/QML wrapper library for the ZXing library. 1D/2D barcode image processing library
Apache License 2.0
614 stars 338 forks source link

QZXing Crashing on Qt6.4 on IOS for latest Iphone 13 #223

Open kpkale opened 1 year ago

kpkale commented 1 year ago

I have created the simple App with QML Application. However, I am getting an error as follows:

Error: You are creating QApplication before calling UIApplicationMain. If you are writing a native iOS application, and only want to use Qt for parts of the application, a good place to create QApplication is from within 'applicationDidFinishLaunching' inside your UIApplication delegate.

This error is seen whether I deploy the application on Simulator IPhone 14 or on actual device. And that happens whether I deploy from Qt Creator or from within XCode.

Unable to find a way to get this working, Uploading the test project. DTest4.zip

angeluslove commented 1 year ago

I also encountered the same problem. After excluding other modules, I located to qzxing qt6.4.1 iOS

angeluslove commented 1 year ago

qt6.2.4 qzxing v3.3.0
error: You are creating QApplication before calling UIApplicationMain. If you are writing a native iOS application, and only want to use Qt for parts of the application, a good place to create QApplication is from within 'applicationDidFinishLaunching' inside your UIApplication delegate.

angeluslove commented 1 year ago

A solution has been found for the time being. It is to use static compilation, and then integrate it into the program using static libraries, so that no error will be reported

Qt6.4.1 qzxing 3.3.0

StefanoD commented 1 year ago

I googled for this error and found this: https://stackoverflow.com/questions/45508043/qt-ios-linker-error-entry-point-main-undefined/45617820#45617820

and this: https://stackoverflow.com/questions/25353686/you-are-creating-qapplication-before-calling-uiapplicationmain-error-on-ios