in reply to EXE missing module at runtime

What command are you using to generate the EXE?

Quite possibly your JSON module is not located at the same place as the other modules you are using and is not found when the EXE is generated.

If you are using Perl2Exe, you should use following option to include the modules:

-I=dir1:dir2
where dir1 and dir2 are the directories where the modules you want to include are located.

Replies are listed 'Best First'.
Re^2: EXE missing module at runtime
by Anonymous Monk on Aug 28, 2014 at 17:04 UTC

    But sorry, it doesn't make sense. The exe HAS all the modules, otherwise it will not run on ANY machines! Am I wrong?

      It is not me, but YOU, who said that your system reports that the JSON module is missing. Maybe the users on the other machines (those where it works) are using parts of the program that do not require JSON, maybe Perl and Json are installed on some of the other machines, maybe still something else. I am just trying to make some possible sense from the limited information you have provided. It seems to me (from discussions on previous posts here and on other forums, I haven't checked that myself) that Perl2Exe will not complain if it does not find one of the modules that is supposed to be included, because it will "think" that the module will be available on the platform where the EXE will run.

      Now, having said that, you haven't answered my questions and said how you generate your EXE. So long as you don't say that and provide the exact command line you used for generating the EXE, we can only make wild guesses.

        Sorry for not explaining the problem the right way. Again, I distribute a software written in Perl (Exe created with PerlApp->ActiveState). The software runs on hundreds of machines without problems. The machines do not have Perl installed, that is for sure. Now and then, some Windows 8.1 users report that the EXE does not start. I checked on one of this machines and I discovered that at runtimes the Exe fires an error complaining that JSON was not found. By now, I just trim my script so that it will no complain if it soes not find the module. Of course, the functions relying on this module will not work. What I am trying to understand is why on some machines (1 out of 200?), I get this error.