[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] libapl load problem....

From: Juergen Sauermann
Subject: Re: [Bug-apl] libapl load problem....
Date: Thu, 17 May 2018 21:29:23 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Hi Peter,

Not sure. First of all, GNU APL does not use the symbol _CERR, only CERR without underscore.
However, sometimes linkers add a leading underscore to symbol names under certain circumstances,
snf I duppodr thst is the case here.

Normally CERR is defined in the libapl.so library file:

address@hidden:~/projects/juergen/apl-1.7/src$ nm -D ./.libs/libapl.so |grep CERR
002d5040 B CERR
002d5420 B CERR_filebuf
00119510 T _Z8get_CERRv
002d6460 B _ZN11Performance9fs_CERR_BE
002ca080 D _ZN6Output10color_CERRE
002ca1ec D _ZN6Output21color_CERR_backgroundE
002ca1f0 D _ZN6Output21color_CERR_foregroundE

How3ever, the
—with-android ./configure option disables CERR because android
seems not to have the standard input and output streams that Unix resp. C++ have. In that
case you have to provide it yourself somehow.

In Common.hh there is a declaration:

extern ostream CERR;

but the file implementing it (Output.cc line 97 ff.) does not instantiate CERR if compiled for android:

// Android defines its own CIN, COUT, CERR, and UERR ostreams

CinOut CIN_filebuf;
CIN_ostream CIN;

ostream COUT(&DOUT_filebuf);
ostream CERR(CERR_filebuf.use());
ostream UERR(&UERR_filebuf);


The comment is slightly misleading: instead of "Android defines its own CIN, ..." it should
read: "Android is supposed to define
its own CIN, ..." .

Best Regards,
/// Jürgen Sauermann

On 05/17/2018 06:10 PM, Peter Teeson wrote:
Hi all:
The following is for svn 1048 ./configure —with-android —with-libapl
Using MacOS Yosemite 10.10.5 and Xcode 6.4 and a vanilla Cocoa Document app.

In the AppDelegate code I have the following:

void *libaplHandle; // plain C file pointer

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Load libapl from default location.
    const char* libaplPath="/usr/local/lib/apl/libapl.so"; // TO DO Make this path a User Preference....}

    libaplHandle = dlopen(libaplPath, RTLD_LAZY|RTLD_GLOBAL);
    if (NULL == libaplHandle) {
        char *error = dlerror();
        printf("AppDelegate - dlopen(libaplHandle) error: %s",error);

AppDelegate - dlopen(libaplHandle) error: dlopen(/usr/local/lib/apl/libapl.so, 9): Symbol not found: _CERR
  Referenced from: /usr/local/lib/apl/libapl.so
  Expected in: flat namespace
 in /usr/local/lib/apl/libapl.so

I really have no idea why this happens. Please educate me…..

Thanks and



Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]