SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

The engine.
Post Reply
prock
Posts: 4
Joined: Sat Dec 12, 2020 1:44 pm

SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by prock »

I have read other posts about this and know that you will get this error when the smile_license.h is corrupt, expired or otherwise incorrect.

How can I handle this error or exception?
I am developing a flutter app (not for public) that uses the SMILE Engine. When I compile the code and have the app on a device, it crashes when the license is expired. Instead I would love to catch the error and handle it instead of my app crashing.
I tried to use a try...catch block around the first occurence of any SMILE related instruction with no success.
I tried to compile my code in a static library such that I could call the library and if the result is "SMILE INITERR ..." I could handle the error that way. This may have failed because I have done it wrong for my lack of understanding C++ compiling and linking especially. I tried it with a .exe as well, like calling a third party API or in this case software for the result but still no success.

My code builds, but whenever I run it, I can not get anything else from it than SMILE INITERR 0E or 0D...
Furthermore I would love to write a test case with google test that tests the error handling (if it works). I think this might be possible with including different smile_license.h depending on the test case with ifdef etc. but I wouldn't know how to. This is not my primary problem, as long as I can keep it from crashing its fine.

I am using Visual Studio 2019, with SMILE Core in C++.
For the app I use the newest version of flutter and dart. The code is used with dart:ffi.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by shooltz[BayesFusion] »

INITERR 0E is the code for expired licensing key.

INITERR 0D is caused by mismatched academic/business licensing key (an attempt to use the academic key with business binaries, for example).
prock
Posts: 4
Joined: Sat Dec 12, 2020 1:44 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by prock »

Thank you but I figured that much out already by testing it myself. I looked at similar posts in this forum that explained some of the error codes already.
But as I said, the main problem I am facing is that it is not testable and usable in my app due to it crashing if there is a problem with the license.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by shooltz[BayesFusion] »

it is not testable and usable in my app due to it crashing if there is a problem with the license.
Your problem with the license is directly related to the expiration of the license key. For long-term use you'll need a deploment license. For SMILE Business, you need a commercial deployment license. If you're an academic user and BayesFusion's academic license (https://download.bayesfusion.com/license_academic.txt) applies to your project, send us an email from your university account, as indicated at our download site and in SMILE Manual.
prock
Posts: 4
Joined: Sat Dec 12, 2020 1:44 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by prock »

Yes I understand that this is the case. So what you are saying is, that it is not possible to test this?
When I want to publish the app or use it somewhere outside of my dev environment I will look into the licensing, but until then I would like to have SMILE in my app, with an expired or corrupt license and when I try to use it get an exception that I can handle. Instead I now have an app that crashes.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by shooltz[BayesFusion] »

Are you using Business or Academic edition of SMILE?
prock
Posts: 4
Joined: Sat Dec 12, 2020 1:44 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by prock »

I am using Academic edition of SMILE.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE (Visual C++) INITERR 0E, Error handling, Flutter, Dart, C++

Post by shooltz[BayesFusion] »

If you're an academic user and BayesFusion's academic license (https://download.bayesfusion.com/license_academic.txt) applies to your project, send us an email from your university account, as indicated at our download site and in SMILE Manual.
Post Reply