Page 1 of 1

Linking newLISP source and executable question?

Posted: Fri Nov 04, 2011 6:22 pm
by GDavidModica
Hi all,

I am new to newLisp and working through the manual. The example says:
(1) Put the following files into the same directory: (a) a copy of the newLISP executable; (b) newlisp (or newlisp.exe on Win32); (c) link.lsp; and (d) the program to link with (uppercase.lsp in this example).
On Linux I don't understand the distinction between a) and b). Assuming they are the same and using this directory

Code: Select all

$ ls Lisp/newLispCode
 link.lsp  newlisp  uppercase.lsp
I get the following results:

Code: Select all

$ newlisp link.lsp
Hi
newLISP v.10.3.3 64-bit on Linux IPv4/6 UTF-8, execute 'newlisp -h' for more info.

> (link "newlisp" "uppercase" "uppercase.lsp")
original newlisp executable:newlisp
new executable:uppercase
source:uppercase.lsp
true
> (exit)
$ chmod 775 uppercase
$ ./uppercase "convert me to uppercase"
newLISP v.10.3.3 64-bit on Linux IPv4/6 UTF-8, execute 'newlisp -h' for more info.

> (last-error)
nil
> 
The executable uppercase is 76 bytes larger than newlisp but behaves as if nothing was linked in.

Can anyone point out what I am missing?

Re: Linking newLISP source and executable question?

Posted: Fri Nov 04, 2011 8:36 pm
by Lutz
Sorry for the confusion. In the manual it should say (now corrected online):
Put the following files into the same current directory: (a) a copy of the newLISP executable, either newlisp or newlisp.exe on Win32; (b) link.lsp; and (c) the program to link with (uppercase.lsp in this example).
Make sure all three files are either in the current directory, or specify full path-names for all components.

Also, I just found out, the link feature only works with 32-bit versions of newLISP (I will try to fix this for the next version). You are running 64-bit. Perhaps you can compile for 32-bit using the makefile_linux or makefile_linux_utf8 makefile to make for 32-bit:

Code: Select all

make -f makefile_linux_utf8

Re: Linking newLISP source and executable question?

Posted: Fri Nov 04, 2011 9:20 pm
by GDavidModica
Thanks Lutz,

It is nice to know I'm not crazy. I will watch for the 64 bit fix - no hurry.

Re: Linking newLISP source and executable question?

Posted: Fri Nov 04, 2011 11:08 pm
by Lutz
The link.lsp problem for 64-bit versions is fixed here:

http://www.newlisp.org/downloads/develo ... nprogress/

An official development version will be released coming week.

Re: Linking newLISP source and executable question?

Posted: Sat Nov 05, 2011 3:31 pm
by GDavidModica
It works! Thank you.