Thanks for addressing this, Lutz.
Lutz wrote:I cannot repeat that error, no matter if using the 32-bit or 64-bit of newLISP. Can you give exact instructions, how the the link was made and the resulting linked script is used? I am also on OSX Lion.
Here are the directories I'm working with:
Code: Select all
~/dev/newlisp/utils/
~/dev/newlisp/utils/build/
The `utils` folder contains my source file, `mgrep.lisp`. The `build` folder contains my newLISP executable and the `link.lsp` file. When I'm ready to build a self-contained executable from my source file, I copy it into the `build` folder so that the newLISP executable, the `link.lsp` file, and my source file are in the same directory.
I wrote one extra function into my `link.lsp` file (
code here) so I can just write:
...and it evaluates as:
Code: Select all
(link "newlisp" "mgrep" "mgrep.lisp")
So when I run `newlisp link.lsp` at the command-line and then run my `program` function, the output is:
Code: Select all
original newlisp executable:newlisp
new executable:mgrep
source:mgrep.lisp
true
Lutz wrote:There should be no space in here "#! /usr/bin/newlisp", instead "#!/usr/bin/newlisp".
Then on UNIX systems, like Mac OSX, you can just execute mgrep by itself after making it executable with "chmod 755 mgrep", no linking required.
Noted, I'll fix the space. It runs fine as a script regardless, which is why I have this question. I want to make executables so I can share my utilities with other folks without them having to install newLISP.
Lutz wrote:link.lsp doesn't compile anything, it just takes the source script, encrypts it and appends it to the end of a newLISP executable. When linking, make sure you have a newLISP executable and the source in the current directory. When instead using pathnames to point to different locations, make sure you don't point to linked versions of files. Like with a raw script, you have to make it executable.
Understood. I'm pretty sure I hit all your points in my above process, and as I mentioned, it works under certain circumstances. Thanks again for the help.