http://qs321.pair.com?node_id=909731

anu_1 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to execute an exe on i386 Sun 5.10 platform. The exe has been created by perl2exe with the following command

./perl2exe -tiny -v -platform=SunOS -o=test.exe test.pl

When trying to execute the exe , I am getting the error "Cannot execute". The same exe is running on SPARC. I checked the lib under perl5 folder it contains sun4-solaris. Does it mean the exe will be created for SPARC only ..? Thanks a lot for help

Replies are listed 'Best First'.
Re: perl2exe problem
by marto (Cardinal) on Jun 15, 2011 at 09:58 UTC

    SPARC and intel are different architectures, your SPARC binary won't work on an intel platform.

Re: perl2exe problem
by sundialsvc4 (Abbot) on Jun 15, 2011 at 12:21 UTC

    Every operating system and every computer architecture is different.   Software built to run natively in one environment won’t run on the others.   The only reason why Perl programs “run” is that, from the operating system’s point-of-view, it is the Perl interpreter that is actually “running.”   Both it and any XS code that is in-use was custom built for the environment.   Any programming which “wraps” a Perl program into “an executable” must by definition do so in an operating-system dependent way, so that the resulting program not only runs, but does the right thing.