java.lang.UnsatisfiedLinkError in Linux

71

Solution 1

Did you try -Djava.library.path=/path/to/library?

EDIT: Re-reading the error message, it looks to me that the native library you're loading is trying to link to glibc version 3.4.9, which apparently is not installed. Can you check what version of glibc you have? What Linux distro are you running?

EDIT2: The problem seems to be narrowed down to libstdc++. I'm about to the edge of my knowledge, but this thread might be useful. It suggests upgrading to gcc 4.2; from the comments, you appear to have version 4.1.2. Let me know if that doesn't work.

Solution 2

subes, JXGrabKey dev here ...

I don't know much about this error myself, but your lead about gcc and/or libstdc++ should be right

Personally I am using the gcc version shipped with Ubuntu 8.10 atm. I always stick to the latest version shipped.

Current version: g++ (Ubuntu 4.3.2-1ubuntu12) 4.3.2

The following libstdc++ packages are installed on my machine: http://packages.ubuntu.com/intrepid/libstdc++5 http://packages.ubuntu.com/intrepid/libstdc++6

Hope this helps, if you find anything useful, tell me. :) Maybe i have to compile jxgrabkey with an older version of gcc for releases, so it is downwards compatible? Does anyone have a wise advice? ^^

Share:
71
Idris.AH
Author by

Idris.AH

Updated on September 29, 2020

Comments

  • Idris.AH
    Idris.AH over 3 years

    I am using Angular6, I am implementing Stripe payments in my app and using Google Cloud functions to run server side code. I can successfully get the payment to work, however, I am adding more logic to my function. In this function, I am processing the payment. My cloud function runs when I onWrite a document to /payments/${this.userId}/payments collection.

    in the .then block of code, I want to the check if the Stripe payment was successful, and only if it was successful, then update the user's details in the database with the appropriate documents. However, I am not sure if this is the best method.

    Also, currently, I am listening to changes in the document where the Stripe charge object will be returned, using onSnapshot, however, once it is succeeded, I don't want to listen to those value changes until another payment is made.

    How can I achieve this behaviour?

    processPayment(token: any, amount: number){
    
        const payment = { token, amount };
      this.paymentCollection.doc(`${this.userId}`).collection('payments').add({
                payment
            })
        .then(docRef => {
            this.docRefId = docRef.id;
            //if payment successful then add to the db of purchased lessons
            console.log(this.docRefId);
            this.db.collection("payments/"+`${this.userId}`+"/payments").doc(`${this.docRefId}`)
            .onSnapshot(function(doc) {
                if(doc.data().status === "succeeded"){
    
                const updatedBalance = this.balance - amount;;
    
                let writeBatch = firebase.firestore().batch();
    
                //CAN'T SEE CART CONTENTS
    
                for(let buyable of this.cartContents){
                    let purchasedLessonsRef = this.afs.firestore.doc(`/purchased_lessons/${this.userId}/lessons/${buyable.b_id}`);
                    writeBatch.update(purchasedLessonsRef, buyable);
                }
    
                //Update balance ref
                let userBalanceRef = this.afs.firestore.doc(`/users/${this.userId}`);
                writeBatch.update(userBalanceRef, {balance: updatedBalance});
    
                this.docRefId = null;
    
                return writeBatch.commit().then(function () {
                    console.log("commiting batch")
                });
            }
        });
    
        console.log("finished function");
        })
    .catch(error => console.error("Error adding document: ", error))
    

    }

  • palantus
    palantus about 15 years
    Actually, from the error, it looks like the library you're loading is trying to link to a version of glibc that you don't have.
  • OscarRyz
    OscarRyz about 15 years
    @mmyers@your edit: Sure. How do I do that? :S ... is there something like glibc -version? ....
  • palantus
    palantus about 15 years
    glibc isn't an executable, so that won't work. What distro are you running?
  • palantus
    palantus about 15 years
    What does uname -rs give you?
  • OscarRyz
    OscarRyz about 15 years
    uname -rs yields Linux 2.6.18-53.el5, I think I found the command: rpm -q glibc returns glibc-2.5-18
  • palantus
    palantus about 15 years
    RedHat or a derivative, then. And actually, it's glibcxx that is wanted, not glibc. A little googling reveals that glibcxx is provided by libstdc++, so can you check the version on that?
  • OscarRyz
    OscarRyz about 15 years
    Yeap. Look at this: rpm -qa | grep gcc [returns] gcc-c++-4.1.2-14.el5
  • OscarRyz
    OscarRyz about 15 years
    Hey subes! Thank you for the response. Yes, actually a dig further in other forums and the problem was the compiler. So, since the C++ code is available I recompile it with my gcc version, but then I've got _ZNSs4_Rep20_S_empty_rep_storageE :-( :-( I'll try to get that g++ in my installation. Tnx
  • subes
    subes about 15 years
    ok, if you find more about it, please tell me if you manage to get it work it would be nice if you could write a wiki article about this on the jxgrabkey wiki on sourceforge ^^ so if other people have the same problems, they can follow your guidelines. (and maybe i can make compatibility releases)
  • stdcerr
    stdcerr over 6 years
    @subes I'm having the same issue with WindRiver Workbenck on Ubuntu 14.06 that is. I have installed above suggested packages but it still doesn't work for me... do you have any further clues? I read you recompiled the C++ compiler, is this what I have to do, too? My currentr gcc version is 5.4.0
  • subes
    subes over 6 years
    You don't need to recompile the C++ compiler, instead you have to recompile the libjxgrabkey.so with your own local compiler so it links to your version of libstdc++. Just run the jxgrabkey/trunk/misc/Ant/build.xml to build a release from this subversion repo: sourceforge.net/p/jxgrabkey/code/HEAD/tree (you need to have ANT ant.apache.org installed and some developer c++ dependencies for X11 and so on)
  • subes
    subes over 6 years
    You can find a more elaborate explanation on how to do this here: sourceforge.net/p/jxgrabkey/bugs/6 maybe this helps too: sourceforge.net/p/jxgrabkey/bugs/8