Can anyone tell me where I got wrong in my jni conde?

I am new to jni.
I want to pass a class from java to C, and after some data value inserting, this class will be returned to Java.
But the exception occured: java.lang.UnsatisfiedLinkError.
I can't see where the error is.
So anyone can give me any suggestions??
I'll paste my test code as follows:
TestSCJNI.java
import java.lang.*;
public class TestSCJNI {
          static {
          System.loadLibrary("TestSCJNI");
     private native ServiceComp test_queryServiceComp(ServiceComp _sc);
     ServiceComp sc;
     public TestSCJNI(){
          sc = new ServiceComp();
     public static void main(String[] args) {
          TestSCJNI t = new TestSCJNI();
          t.sc = t.test_queryServiceComp(t.sc);
          System.out.println("tsId" + t.sc.tsId + "NwID" + t.sc.orginNwId);
     class ServiceComp {
          char tsId;
          char orginNwId;
          char svId;
}TestSCJNI.c
#include <stdio.h>
#include <stdlib.h>
#include <jni.h>
#include "TestSCJNI.h"
JNIEXPORT jclass JNICALL Java_TestSCJNI_test_queryServiceComp(JNIEnv *env, jobject obj, jobject sc) {
     jclass t = (*env)->GetObjectClass(env,sc);
     (*env)->SetCharField(env,t,"tsId",12);
     (*env)->SetCharField(env,t,"orginNwId",0);
     (*env)->SetCharField(env,t,"svId",3);
     //t.orginNwId = 0;
     //t.svId = 3;
     return t;
} Thanks for any help!

yes. The procedure I run the program are :
1. javac *.java
javah -jni TestSCJNI
2. gcc -c TestSCJNI.c
3. gcc �shared -o libTestSCJNI.so TestSCJNI.o
4. java -Djava.library.path=. TestSCJNI
I supposed that the procedure is right...
Or something incorrect in the procedure??This is just a wild guess, but what happens if you replace step
2) and 3) by one new step? like this:
gcc TestSCJNI.c -o libTestSCJNI.so -shared -I<include stuff here>
I suspect that gcc generates position dependent code if it just has
to compile a compilation unit. The -shared flag implies the -fPIC
flag for compilation if I'm not mistaken ...
kind regards,
Jos

Similar Messages

  • Can anyone tell me where I can find a beginners guide to the filing system?

    Can anyone tell me where I can find a beginners guide to the filing system on the Macbook Air iOS 10.9.4?

    So, does this mean you have given up and decided to return to the MS Windows (PC) embrace?
    The link that dominic23 provided has parts 1, 2, and 3 — did you review all of these? What remaining question(s) do you have about the Apple file system?
    Videos that you may find on the Apple site are not updated regularly, and steps/techniques shown in them may be outdated, or not work as shown on the current operating system release.
    Did you look into the Apple Retail Store One to One learning assistance?
    Did you consider either of the following books as a learning aide?
    Switching to the Mac: The Missing Manual, Mavericks Edition
    OS X Mavericks: The Missing Manual

  • I've installed LeechBlock and now I can't find it! Can anyone tell me where/ how to access it?

    Hi there,
    I'm new to using addons, so please forgive my ignorance. I've installed LeechBlock and now I can't see where to find it. Can anyone tell me where/ how to access it? I've looked under Addons in the Tools menu, but this just has options to install more addons.
    I had thought there'd be a button on the toolbar, or even a new toolbar, but I can't see anything...
    Thanks in advance!

    Hi, you're nearly there! When you are looking at the Add-ons you need to select Extensions on the left-hand side, and you should see it, together with your AdBlock plus. There might also be a button in the 3-bar menu - but I'm not familiar with that particular Add-on so can't be sure about that.
    Hope that helps.

  • Can anyone tell me where to send my i phone to for repair?? I have paid by card on this site but been given no details as to what address it is to be sent . i am not a computer whizz but not an idiot either and i am becoming more and more frustrated !!!!!

    Can anyone tell me where to send my i phone to for repair?? I have paid by card on this site but been given no details as to what address it is to be sent . I am not a computer whizz but not an idiot either and i am becoming more and more frustrated !!!!!

    Yes, AppleCare can tell you.  Below is the number for AppleCare in the US. 
    1-800-APL-CARE *
    1-800-275-2273
    Hours of Operation: 7 days a week from 5am - 8pm Pacific time.
    If you live outside the US, additional contact information can be found at this link.
    http://support.apple.com/kb/he57

  • Itunes document manager pro will not open a document with .cwk extension. It will catch the document then error message states that it cannot open document. Can anyone tell me what Im doing wrong?

    Itunes document manager pro will not open a document with .cwk extension. It will catch the document then error message states that it cannot open document. Can anyone tell me what Im doing wrong?

    Forgive my ignorance but I have never hear of iTunes Document Manager Pro. If you mean Document Manager Pro, i was able to find that. Back to your problem, have you tried opening one of those files in the iOS iWorks apps? Form the quick read that I did about this, .cwk files can be opened by Pages, Numbers or Keynote, depending on what type of document that it is and those files can be read by Document Manager Pro, after properly saving them. I don't see that you can go directly from the .cwk file in Document Manager Pro without converting them first.
    I took a very quick look at the app, so I may be a missing something about its capability.

  • TS1702 I have a charge on my CC that does not track to any purchases nor do I have an email receipt.  Can anyone tell me where/how I can get this deleted (charge is from 04/08 so nearly two weeks old)?  Thanks!

    I have a charge on my CC that does not track to any purchases nor do I have an email receipt.  Can anyone tell me where/how I can get this deleted (charge is from 04/08 so nearly two weeks old)?  Thanks!

    Apple could not tell you who else might be using your credit card, so there's no point in trying to contact them. All they could discuss with you is your own iTunes Store account, and if there's nothing in your purchase history, the charges almost certainly aren't coming from there. Again, you should take this up with your bank/credit card company and report these charges as fraudulent. They probably will cancel your card and issue you a new one.
    Regards.

  • I have set up folders to file my emails on iCloud but notice that some of the emails are missing. Can anyone tell me where they are and how to get them back.

    I have set up folders on iCloud to file my mail but notice that some of the emails are missing when I've transferred them. Can anyone tell me where they are and how to get them back please?

    This can be a problem with the file places.sqlite that stores the bookmarks and the history.
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Can anyone tell me where I might find my movie,

    Can anyone tell me where I might find my movie, its not in the project file......I closed imovie and when I came came back the next day, the project was gone! Any input would be greatly appreciated! Thanks in advance!

    If no one here is able to help there is an iMovie, please re-post there.

  • Can anyone tell me where i can get a new or used sony super drive dwu10 678-0429b in the UK, for my flat panel i mac g4  model no m9168lla , or  is there  any other compatable drives i could fit

    can anyone tell me where i can get a new or used sony super drive dwu10 678-0429b in the UK, for my flat panel i mac g4  model no m9168lla , or  is there  any other compatable drives i could fit

    Try eBay. You do occasionally see that old model advertised there.

  • I have ilife 09 preinstalled on my mac and im downloading guitar lessons from the lesson store but lesson number 1 isnt there. can anyone tell me where i could get it?

    I have ilife 09 preinstalled on my mac and im downloading guitar lessons from the lesson store but lesson number 1 isnt there. can anyone tell me where i could get it?

    You might profit from a visit to a Minneapolis Apple store. With a brand new Mac, I think they will be most helpful - not just with transferring files, but with other advice as well. And I strongly recommend you invest in a back up drive. The Apple folk can help with that as well.

  • HT4199 Had problems with my broadband going down at weekend, since it came back on unable to join wifi BT say it is because my wifi settings are missing on my iPad can anyone tell me where to find seething details IP address etc

    Had problems with my broadband going down at weekend, since it came back on unable to join wifi BT say it is because my wifi settings are missing on my iPad can anyone tell me where to find seething details IP address etc

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are drooping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    Fix WiFi Issue for iOS 7
    http://ipadnerds.com/fix-wifi-issue-ios-7/
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    iPad: Issues connecting to Wi-Fi networks
    http://support.apple.com/kb/ts3304
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h Mt
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    10 Ways to Boost Your Wireless Signal
    http://www.pcmag.com/article2/0,2817,2372811,00.asp
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Some Wi-Fi losses may stem from a problematic interaction between Wi-Fi and cellular data connections. Numerous users have found that turning off Cellular Data in Settings gets their Wi-Fi working again.
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Can anyone tell me where to download Englsih cersion of Bonjour and Apple Software Update. Currenely I   only obtain the Mandarin version and would like to install on my D: drive, rather than default to C. Thanks

    Can anyone tell me where to download English version of Bonjour and Apple Software Update. Currently I
    only obtain the Mandarin version aI am trying to install on my D:\ drive, rather than default to C:\.
    Thanks.

    This would be a better question for the iTunes forums.
    https://discussions.apple.com/community/itunes
    B-rock

  • Hi, can anyone tell me where i can purchase a copy of flash professional 8

    Hi, can anyone tell me where i can purchase a copy of flash professional 8

    Not here. It's too far back for Adobe to sell.
    You might find a copy on e-bay, but you take a risk buying software there, and even if the installer is valid, you'd need a valid product key or you'll only get 30 days out of it. Even ProDesignTools only goes as far back as CS3 with Flash.
    Also, unless you're going to install it on a very old computer, I wouldn't expect much out of it.

  • Can anyone tell me where to find an install guide for the Liveoffice app.

    Can anyone tell me where to find an install guide for the Liveoffice app.
    Thanks
    Jeff

    Hi Jeff,
    You can download the install guide for Liveoffice application from the link provided below,
    http://help.sap.com/businessobject/product_guides/boexi/en/boXI_LiveOfficeInstall_en.pdf
    Hope this helps you.
    Regards,
    Abhijeet T.

  • I backed up my iphone 3 in preparation for moving to iphone 4S and before i changed the sim card I discovered my notes had been wiped!  It looks like this is quite common but can anyone tell me where the notes I backed up on itunes would be???

    I backed up my iphone 3 in preparation for moving to iphone 4S and before i changed the sim card I discovered my notes had been wiped!  It looks like this is quite common but can anyone tell me where the notes I backed up on itunes would be???

    In the iPhone backup. Right click on the phone in iTunes and choose "Restore from Backup".

Maybe you are looking for

  • PCR to call WTs from last Regular payroll

    Team, How to fetch /  Call one WT from last Payroll result. Eg: We are using one WT " 9XXX"  (total of 10 Wts) in regular Payroll. In offcycle WT  "9YYY" calculating based on this WT "9XXX" So we can process of-cycle only after processing regular Pay

  • How to access jms queue in NetWeaver X from NetWeaver Y

    Hi experts, I would like to know whether accessing jms queue in NetWeaver X from NetWeaver Y is possible or not using web application. I have one web application that is deployed in NetWeaver Y and I want to access jms queue in NetWeaver X (Not Y). I

  • Standalone Web Service Client: NullPointerException

    Hello, I failed running a standalone SAP Web Service application. I built the jar using Netweaver Developer Studio and wrote an application using the stubs. When running the client I get a NullPointerException with its root cause in a SAP provided cl

  • How can I unlock my iPhone 4 speaker

    I was watching a video and I can't hear any sound

  • Look for Fm

    Hi I look for 2 Fm 1.Fm that i will give here range of date and day and i will get all the dates that found in the range for exmaple: 01/05/2007-15/05/2007 i want only sunday so i will get the date: 6/05/2007,13/05/2007 2. I look for fm that i will g