Is that possible to call a static library?

Hi,
I'm using JNI to call a third party static library (.a file), but I always got the java.lang.UnsatisfiedLinkError. I'm not sure whether it is possible to invoke APIs from static c libraries. Anyone here has this kind of experience ?
Here is my scenario:
I have a native method in java class named sendMessage(), and implement this method in message.c(function: Java_MessageSender_sendMessage()) by calling a API in a third party static library(msg.a). However when I run the java class, I always got the error. But If I just run the main() of message.c which also calling the Java_MessageSender_sendMessage(), it will be ok.
some code of c file:
Java_MessageSender_sendMessage()
printf("hello");//this line can be executed
sendMessage();//this line is calling the static library, and error occurs here when the function called from java side
int main(int argc, char *argv[])
Java_MessageSender_sendMessage()//It's ok when directly run this application
Any information will be helpful to me.
Thanks in advance

Hi, bschauwejava
Thanks for your reply.
As you have said, the static libraries already have been linked when I made the libmessage.sl using aCC:
aCC -z -b -o libmessage.sl message.o -lmsg
Is there anything wrong with the command?

Similar Messages

  • Possible to create a static library (.a) file for Xcode with Flash Builder?

    Is it possible to write code in AIR that can be compiled to static library (.a) to be used in an iPad app?

    Hey paulhart83,
    My guess is therabbitwindfall's answer was correct but where you able to find a solution to your question? If so, please do share. I need to embed my app within another app and the only way is through a static library. I'd rather not have to re-develop my app in Xcode in order to generate the .a file.
    Thanks.
    Novian

  • How to call a static method in a class if I have just the object?

    Hello. I have an abstract class A where I have a static method blah(). I have 2 classes that extend class A called B and C. In both classes I override method blah(). I have an array with objects of type B and C.
    For every instance object of the array, I'm trying to call the static method in the corresponding class. For objects of type B I want to call blah() method in B class and for objects of type C I want to call blah() method in C class. I know it's possible to call a static method with the name of the object, too, but for some reason (?) it calls blah() method in class A if I try this.
    So my question is: how do I code this? I guess I need to cast to the class name and then call the method with the class name, but I couldn't do it. I tried to use getClass() method to get the class name and it works, but I didn't know what to do from here...
    So any help would be appreciated. Thank you.

    As somebody already said, to get the behavior you
    want, make the methods non-static.You all asked me why I need that method to be
    static... I'm not surprised to hear this question
    because I asked all my friends before posting here,
    and all of them asked me this... It's because some
    complicated reasons, I doubt it.
    the application I'm writing is
    quite big...Irrelevant.
    Umm... So what you're saying is there is no way to do
    this with that method being static? The behavior you describe cannot be obtained with only static methods in Java. You'd have to explicitly determine the class and then explicitly call the correct class' method.

  • Calling non-static command from within static method

    Hello,
    I have a static method that reads bytes from serial port, and I want to set a jTextField from within this method. but I get error that says it is not possible to call non static method from a static one. How can it be solved?

    ashkan.ekhtiari wrote:
    No, MTTjTextField is the name of jTextFiled class instance.You haven't declared any such variable in the class you posted, not to mention that such a variable name violates standard code conventions.
    This is and instance of that object actually. You haven't declared any such variable in the class you posted.
    the problem is something else. No, it isn't, based on the information you have provided. If you want accurate guidance, don't post misleading information about your problem.
    It can not be set from within static method.A question commonly asked on Java forums concerns an error message similar to the following:
    non-static variable cannot be referenced from a static context
    In Java, static means "something pertaining to an object class". Often, the term class is substituted for static, as in "class method" or "class variable." Non-static, on the other hand, means "something pertaining to an actual instance of an object. Similarly, the term instance is often substituted for non-static, as in "instance method" or "instance variable."
    The error comes about because static members (methods, variables, classes, etc.) don't require an instance of the object to be accessed; they belong to the class. But a non-static member belongs to an instance -- an individual object. There's no way in a static context to know which instance's variable to use or method to call. Indeed, there may not be any instances at all! Thus, the compiler happily tells you that you can't access an instance member (non-static) from a class context (static).
    Once you understand this concept, you can fix your own problem.
    ~

  • Possibility of calling ALV report

    hi experts,
    i have a requirement that i have to design an entry screen whcih contain pushbuttons (SAVE, CLEAR ,DISPLAY).
    whenever user pressed DISPLAY, he wants to call the selection screen of an alv report which is already exists.
    is that possible to call an alv report selection screen and execute it.
    any suggestions pls.
    thanks&regards
    maheshlap.
    Edited by: Thomas Zloch on Dec 17, 2011 11:07 PM

    Hi,
    Follow this code,
    *DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2,
                      FUNCTION KEY 3.
    **EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY
    AT SELECTION-SCREEN OUTPUT.
    *CLICK OF FIRST RADIO BUTTON
      IF pa = 'X'.
        sscrfields-functxt_01 = 'Materials Management'.
        WRITE icon_plant AS ICON TO text_001.
    *CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO
        LOOP AT SCREEN.
          IF screen-group1 = 'MOD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CLICK OF SECOND RADIO
      IF pb = 'X'.
        sscrfields-functxt_02 = 'Sales And Distribution'.
        WRITE icon_ws_ship AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CLICK OF THIRD RADIO
      IF pc = 'X'.
        sscrfields-functxt_03 = 'Human Resources'.
        WRITE icon_new_employee AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN
    *WITH F8 BUTTON DISABLED
      APPEND :  'PRIN' TO it_ucomm,
                'SPOS' TO it_ucomm,
                'ONLI' TO it_ucomm.
      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status  = sy-pfkey
        TABLES
          p_exclude = it_ucomm.
    Warm Regards,
    PavanKumar.G

  • DLL calling a subsidiary static library

    I've built a DLL using labwindows that calls a subsidiary static library. I've added a step in Test Stand that calls this DLL.  On my development station all is good.  The subsidiary library is called.  But, on a deployed station I keep getting a "Cannot load DLL".
    According to the reference manual, I can preload the subsidiary librarys by using the CVI adapter.  I get the same error on my deployed station...
    Solved!
    Go to Solution.

    You get an error "Could not load a DLL" when one of the dependencies is missing.
    Please check it this way :
    Download free dependency walker --- http://www.dependencywalker.com/
    Select the DLL ( deployed machine).
    It will show which dependency component is missing in the deployed machine.
    For CVI..
    Since you are using a static libarary - did you include it in the build when you build the project?
    It should be embed within your DLL. ( using add files to DLL option in the CVI target settings).
    Hope this helps.

  • Is it possible to call a VI that is inside a LabVIEW executable from a TestStand sequence?

    I have created a custom TestStand operator interface and have modified the default sequential process model to display a UUT information dialog that prompts for more information than just the UUT serial number.  This UUT information dialog is a LabVIEW VI.  To distribute the operator interface, I build it into an executable.  As part of the build process, I make a copy of the UUT information dialog VI (which is part of my operator interface project) and place it in the same folder as the executable.  I have then configured the sequential process model to call the dialog VI from this location.  It would be really nice if I could embed the UUT information dialog VI inside the operator interface executable so that I could distribute just an executable instead of an executable and separate VIs.  Is this possible?  In other words, is it possible to call a VI that is inside a LabVIEW executable from a TestStand sequence just like a standard LabVIEW VI call?

    Ryan,
    The dialog that you've created isn't being directly called by the OI at all and shouldn't need to be included in the same directory as the OI for distribution. Since you are modifying the PreUUT of the default process model, you will give the path to the VI in that step, create a deployment and then manually copy the VI to the directory referenced in the step. The VI is considered a support file for the process model and is not related to the OI at all.
    Test Engineer - CTA

  • HT203167 I would like to download my music from an iPod to iTunes library is that possible? Our last computer got fried so unable to retreive info from it to new computer. Will I have to re-install all the music from CD's?

    I would like to download my music from my iPod touch to iTunes library, is that possible?  Our old computer fried and we were unable to salvage any information.  All of the music that I downloaded from CD's is not in iTunes on our new computer. Will I have to reload all CD's?

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.
    Have you failed to do this?
    If so, then you will need to rip the dvds again

  • I have an iPod classic that syncs my entire library, I'd like to buy a smaller iPod, a nano maybe for the gym. Can I use the same library or do I need to set up a new library for the 2nd iPod? Is that possible? I mean for one to have 2 iTune librarys?

    I have an iPod classic that syncs my entire library, I'd like to buy a smaller iPod, maybe a Nano for the gym. Would I need a 2nd iTunes library? Is that possibly, I mean for one person to have 2 iTune librarys/accounts?

    Woodblock 3 wrote:
    Would I need a 2nd iTunes library? Is that possibly, I mean for one person to have 2 iTune librarys/accounts?
    In other words, no. You don't need another iTunes Library for your new iPod
    Another iTunes Library, that's only if someone elses music is mixed in with yours and you want to create another Windows user account with their music in it.
    The iTunes Library is the master vault containing all your content, from there you create playlists or smart playlists specially tailored for the smaller iPod's storage requirements.
    For instance if the iPod can hold only 2,000 songs, then you create a smart playlist based upon those rules/limitation. Plus what type of music you like.
    You have a incredible degree of control with smart playlists, they update automatically so you only set the conditions for what goes into them. Including content from other created playlists and smart playlists.
    Then, when you hook up the smaller iPod, it has it's own sync options, "all of your music and playlists" or "only select playlists"  So you use the second option to select just the smart playlist you tailored for the new iPod.
    When you hook up the iPod Classic, only it's sync options are used, not the new iPod ones.
    I hope I explained it better this time.

  • I only want to apply iMatch/iCloud to one of my iTunes playlists, not my entire library. Is that possible?

    I only want to apply iMatch/iCloud to one of my iTunes playlists, not my entire library. Is that possible?

    Hello efisch81,
    As far as I know, this is not currently possible. It matches the entire library or none of it. For specific playlist syncing, you'll still need to sync traditionally through iTunes for now.

  • Static library archive of other archives only. Possible in Xcode?

    Hi there,
    I want to create a static library that is an archive (.a file) of other archives Seems straightforward to do this with libtool. However, Xcode doesn't execute the libtool command on build if there are no source files.
    Any ideas?
    Would be nice to have it do this.
    Any advice much appreciated!
    Cheers,
    Max

    If it's giving a ".a" library then it is not a shared library (or DLL) but an archive
    library. It will get linked into your main application as if it's part of it.
    A shared library will end in a .so.
    If you have a project for your .a ensure that you're building a debug
    version of it and that you main application is using the debug version.
    If the .a is a debug version you should be able to put breakpoints
    there. Try NewBreakpoint and choose a Function style breakpoint
    and give it the name of a function in your library.
    Let me know how that goes.

  • Can i calling C code via JNI?-----a static library(libxxtc.a)

    failed always:(
    JNI don't surport the static library ?
    such as libxxtc.a
    please help me!
    thanks!!!

    Start here: http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
    But in general, there's no reason you can't link a static library into a JNI-based program.
    Or if you want to "load" a static library into a JVM process the same way you can load a JNI-based shared library, then the answer is no, static libraries don't work that way, they have to be linked into something else.
    -slj-

  • My 7-year-old iMac died. I don't plan to replace it. It is backed up to Crashplan. Is it possible to restore my iPhoto library to the cloud, i.e. iCloud or Dropbox, so that I can access the photos as needed from my iPad or iPhone?

    My 7-year-old iMac died. I don't plan to replace it. It is backed up to Crashplan. Is it possible to restore my iPhoto library to the cloud, i.e. iCloud or Dropbox, so that I can access the photos as needed from my iPad or iPhone?

    Probably not - but that certainly does not involve iPhoto for the Mac - you need to look at Crashplan support for you options 
    And iCloud is not a place to store photos so that is certainly not a possibility
    If you restore your masters folder out of the iPhoto library you will have all of your original photos to do with what you please
    LN

  • How to terminate VB process that calls VI Dll Library when application closed

    I have simple VB application to call VI DLL library. The problem is the VB executable file will reside in processes list even close the VB application. Looks like VI DLL does not free from memory when VB application unloaded. Did I miss something to terminate or unload VI DLL in VB program or VI program?

    Well, I'm afraid we're down to good old-fashioned debugging tricks - something is happening that the OS doesn't want to kill. You can try to comment out sections of the VI (new feature in LV 8.2!) to see when it starts to work, or review the code looking for things like event handlers, callbacks, mutexes, open file handles, etc. It's hard to say what going wrong at this level. Also if you are calling out to 3rd party code (Call Library Node, ActiveX, .NET), make sure that it isn't creating such items and holding onto them.
    General rules of thumb...
    1. If you don't have a shutdown VI, or some sort of reference close VI, each VI you call from outside (DLL function) must exist with nothing left in LabVIEW - for example, no registered event handlers, no open file handles, etc. Just like camping, "leave it like you found it".
    2. If you do have such a shutdown, ensure that everything is indeed being shutdown correctly.
    Sorry I can't be more specific.
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • GP public API: is it possible to call that using BSP

    Hi
    if we dont want to involve NWDI development,  is it possible to call those GP public APIs using BSP?
    any tutorial avaiable?
    thanks and best regards.
    Jun

    Hi Jun,
    The GP Public APIs are Java APIs and without NWDI/NWDS, it is not possible to use them. It is not possible to call them from the ABAP Side.
    However, it is possible to start a GP Procedures via Web Service. That might help you if you want to start a Guided Procedures from a BSP. But the display of the runtime might be  a problem since it is not possible to jump from a BSP to a portal page. At least, I don't know how if it is possible.
    Hope this helps.
    Best regards,
    David

Maybe you are looking for

  • Compatibility with Windows Vista...HELP!

    Hi, in my office there are 2 Vista that make me crazy! I've a TC for router and NAS, but those 2 Vista have continuous problems to access the data on it. The error that have is: "could not connect to the disk. make sure NetBIOS is enabled and try aga

  • How can I copy and paste a clip already in my timeline

    Here is my problem I am attempting to copy and paste a video clip from video 1 to video 2 and it will not let me do it.  I am using several effects to create a moving face block and it calls for an exact copy of the section with faces to be blocked. 

  • HT1695 ipod touch is not on itunes or computer and not charging

    anyone have any idea what to do? i called apple they put me into recovery i lost the call and when i called back they said i was past my support time so now i am stuck with an ipod that shows cable and itunes on the screen, i have tried different cor

  • Advanced search in iPhoto

    How can you search for photos with an "and" function instead of an "or" function (i.e. only find photos with all names as opposed to all photos with either name)?

  • Use of AUTOMATIC SCENE DETECTION on already existing huge file

    Hello to all for the first time, I have 6 HUGE already imported video files of my videos diary from Himalaya, so they are each 1 hour long files now and to edit the story I need to brake each of those HUGE imported files into individual clips!!! Of c