Problem when using NCurses

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem when using NCurses

Olivier Auverlot
Hi,

I try to use NCurses with GNU Smalltalk but I have some difficulties.

I have downloaded the version 3.2.5 of GNU Smalltalk and compiled it on a
Debian server (8.3 - 64 bits).

Gst works fine but if I try to use NCurses with the code:

PackageLoader fileInPackage: 'NCurses'.
NCWindow clock

I got the following error message:

Object: CFunctionDescriptor new: 1 "<0x7f23abdbb2c0>" error: Invalid C
call-out initscr
SystemExceptions.CInterfaceError(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.CInterfaceError class(Exception class)>>signal:
(ExcHandling.st:161)
CFunctionDescriptor(CCallable)>>callInto: (CCallable.st:165)
NCWindow class>>primInitScr (NCurses.star#VFS.ZipFile/ncurses.st:1)
NCWindow class>>initscr (NCurses.star#VFS.ZipFile/ncurses.st:1360)
NCWindow class>>clock (NCurses.star#VFS.ZipFile/ncurses.st:2712)
UndefinedObject>>executeStatements (a String:1)
nil


libncurses is already installed in my system and I have no error at
compile time.

Someone has an idea ?

Best regards

Olivier
_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Problem when using NCurses

Olivier Auverlot
I have dug in the mailing list archive and I found a similar problem. It
seems that I must write the following code:

PackageLoader fileInPackage: 'NCurses'.

DLD addLibrary: 'libncurses.so.5'.
NCWindow clock.

The code snippet runs fine but it's correct ? Can we do better ?

Olivier

2016-03-28 11:49 GMT+02:00 olivier auverlot <[hidden email]>:

> Hi,
>
> I try to use NCurses with GNU Smalltalk but I have some difficulties.
>
> I have downloaded the version 3.2.5 of GNU Smalltalk and compiled it on a
> Debian server (8.3 - 64 bits).
>
> Gst works fine but if I try to use NCurses with the code:
>
> PackageLoader fileInPackage: 'NCurses'.
> NCWindow clock
>
> I got the following error message:
>
> Object: CFunctionDescriptor new: 1 "<0x7f23abdbb2c0>" error: Invalid C call-out initscr
> SystemExceptions.CInterfaceError(Exception)>>signal (ExcHandling.st:254)
> SystemExceptions.CInterfaceError class(Exception class)>>signal: (ExcHandling.st:161)
> CFunctionDescriptor(CCallable)>>callInto: (CCallable.st:165)
> NCWindow class>>primInitScr (NCurses.star#VFS.ZipFile/ncurses.st:1)
> NCWindow class>>initscr (NCurses.star#VFS.ZipFile/ncurses.st:1360)
> NCWindow class>>clock (NCurses.star#VFS.ZipFile/ncurses.st:2712)
> UndefinedObject>>executeStatements (a String:1)
> nil
>
>
> libncurses is already installed in my system and I have no error at compile time.
>
> Someone has an idea ?
>
> Best regards
>
> Olivier
>
>
_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Problem when using NCurses

Dmitry Matveev
Hi Olivier,

The snippet looks OK.

If you do not want to call PackageLoader/DLD code every time, you can
create a package for your NCurses application which will contain these
details.

More details here:
http://smalltalk.gnu.org/wiki/creating-and-distributing-packages (see
"<module>")

Dmitry

2016-03-28 13:19 GMT+03:00 olivier auverlot <[hidden email]>:

> I have dug in the mailing list archive and I found a similar problem. It
> seems that I must write the following code:
>
> PackageLoader fileInPackage: 'NCurses'.
>
> DLD addLibrary: 'libncurses.so.5'.
> NCWindow clock.
>
> The code snippet runs fine but it's correct ? Can we do better ?
>
> Olivier
>
> 2016-03-28 11:49 GMT+02:00 olivier auverlot <[hidden email]>:
>
> > Hi,
> >
> > I try to use NCurses with GNU Smalltalk but I have some difficulties.
> >
> > I have downloaded the version 3.2.5 of GNU Smalltalk and compiled it on a
> > Debian server (8.3 - 64 bits).
> >
> > Gst works fine but if I try to use NCurses with the code:
> >
> > PackageLoader fileInPackage: 'NCurses'.
> > NCWindow clock
> >
> > I got the following error message:
> >
> > Object: CFunctionDescriptor new: 1 "<0x7f23abdbb2c0>" error: Invalid C
> call-out initscr
> > SystemExceptions.CInterfaceError(Exception)>>signal (ExcHandling.st:254)
> > SystemExceptions.CInterfaceError class(Exception class)>>signal:
> (ExcHandling.st:161)
> > CFunctionDescriptor(CCallable)>>callInto: (CCallable.st:165)
> > NCWindow class>>primInitScr (NCurses.star#VFS.ZipFile/ncurses.st:1)
> > NCWindow class>>initscr (NCurses.star#VFS.ZipFile/ncurses.st:1360)
> > NCWindow class>>clock (NCurses.star#VFS.ZipFile/ncurses.st:2712)
> > UndefinedObject>>executeStatements (a String:1)
> > nil
> >
> >
> > libncurses is already installed in my system and I have no error at
> compile time.
> >
> > Someone has an idea ?
> >
> > Best regards
> >
> > Olivier
> >
> >
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-smalltalk
>
_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Problem when using NCurses

Holger Freyther
In reply to this post by Olivier Auverlot

> On 28 Mar 2016, at 12:19, olivier auverlot <[hidden email]> wrote:
>
> I have dug in the mailing list archive and I found a similar problem. It
> seems that I must write the following code:
>
> PackageLoader fileInPackage: 'NCurses'.
>
> DLD addLibrary: 'libncurses.so.5'.
> NCWindow clock.
>
> The code snippet runs fine but it's correct ? Can we do better ?


Yes, if you have a look at the packages/ncurses/package.xml file you will notice that it already has a libncurses.so dependency. We will need to add a .la/.so symlink in the plugins directory to not have to try the specific version number.

E.g. if you run "strace" on gst could you see which directories are being tried to find a "libncurses.so"?

holger
_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk