Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I need it that way for distribution purposes where no Perl or LibYAML can be installed

Is this a policy or technical limit?

If this a technical limit, then maybe a ZIP file could be used for distribution. The ZIP would contain your program, Perl and all the dependencies needed.

(If your situation requires an installer, there are ways to convert a ZIP file into an installer.)

(Although my primary PC runs Linux, I've only ever setup self-contained ZIP distributions for MS Windows, but this is possible with Linux, MacOS and others.)

For MS Windows, I have started with the portable edition of Strawberry Perl. After downloading and unzipping to a folder, go to that folder and run portableshell.bat

Then you can use the cpan command to install any dependencies from CPAN. You can copy any libraries your C program needs to the lib folder under the c folder.

Once you have your program running in this environment, make a copy of portableshell.bat to yourprogram.bat and customize yourprogram.bat to run your program. If you have several programs, you can make customized copies of portableshell.bat for each.

Test that your yourprogram.bat file(s) launch your program(s) correctly and everything is still running correctly.

Zip the folder containing yourprogram.bat and the dependencies. On a PC with without Perl or your program, unzip the zip file and test your program(s). If everything still works correctly, you now have a ZIP file to distribute.


In reply to Re: Compiling C program with a Static Perl by RonW
in thread Compiling C program with a Static Perl by rodd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-23 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found