Linking newLISP source and executable question?

Q&A's, tips, howto's
Locked
GDavidModica
Posts: 3
Joined: Tue Oct 25, 2011 7:47 pm

Linking newLISP source and executable question?

Post 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?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Linking newLISP source and executable question?

Post 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

GDavidModica
Posts: 3
Joined: Tue Oct 25, 2011 7:47 pm

Re: Linking newLISP source and executable question?

Post by GDavidModica »

Thanks Lutz,

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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Linking newLISP source and executable question?

Post 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.

GDavidModica
Posts: 3
Joined: Tue Oct 25, 2011 7:47 pm

Re: Linking newLISP source and executable question?

Post by GDavidModica »

It works! Thank you.

Locked