Defining Native Libraries? (Unsatisifed link error)

I am testing an application that we previously had working on 10g release 2 (as well as Tomcat and WebLogic, all on Windows). At the moment my application can't find a couple of native libraries, which should be easy enough to fix. Just set the java.library.path.
My problem is that I can't find anywhere in the Oracle 10g administration to specify the locations of the libraries or set the java.library.path that is used. How is this done?
I added the location to the PATH environment variable (which 10g seems to ignore) and I have tried following the docs at http://download-west.oracle.com/docs/cd/B14099_12/core.1012/b13996/oc4j.htm#sthref394 (although I realise this is for release 2 and not release 3) without success.
I've search the forums and this seems to be an oft asked question. Does anyone know how to do it, or can point me at the documentation?
Cheers

Thanks Maro, but I have already tried that without success I am afraid. I had added the following:
<environment>
<variable id="LD_LIBRARY_PATH" value="C:\Program Files\Documentum\Shared" append="true" />
</environment>
I still get "java.lang.UnsatisfiedLinkError: no dmcl40 in java.library.path"
And, indeed, when I look that the java.library.path all I have is
C:\product\10.1.3\OracleAS_1\jdk\bin;.;C:\WINDOWS\system32;C:\WINDOWS;
C:\product\10.1.3\OracleAS_1\opmn\bin;C:\product\10.1.3\OracleAS_1\opmn\lib;
C:\product\10.1.3\OracleAS_1\bin;C:\WINDOWS;C:\WINDOWS\system32
The folder C:\Program Files\Documentum\Shared is also in my PATH environment varibale (which Oracle is ignoring for some reason).
This is really frustrating. :o(

Similar Messages

  • Standalone OC4J 9.0.4 - Loading Native Libraries - Unsatisfied Link Error

    Hello,
    I incidentally happen to have a similar problem as has been described in several posts in this forum. The problem is that of loading Native libraries in OC4J.
    The scenario is
    1) Environment is Standalone OC4J 9.0.4, Windows 2000, JDK 1.4.2
    2) A Java wrapper loads DLL1 which internally loads DLL2.
    (To be more specific the DLL1 is a SAPSSOEXT.DLL and the DLL2 is SAPSECU.DLL. These are used for establishing SSO with SAP portal)
    The phase-1 of Java wrapper loading DLL1 is achieved by setting either the PATH or the java.library.path variables.
    The phase-2 of DLL1 loading DLL2 is what is failing with an Unsatisfied Link Error.
    Since I am using a standalone version and not a OC4J app-server, the OPMN related configuration for specified PATH variables will not be relevant here. Is there any other place where I can configure these.
    regards
    Shivaram

    A small correction to my observation above.
    The call to load DLL1 via System.loadLibrary() is successful. However when I attempt to call any method on it it fails with UnsatisfiedLinkError.
    Contrary to what was written above the error occured even before DLL1 attempted to load DLL2.
    So why is it that the call to loadLibrary is successful but the call to actual function is failing? (This works flawlessly on the command line)
    Is this a path problem, if so how do I configure it in OC4J standalone. Variables PATH, java.library.path, LD_LIBRARY_PATH none of them seem to have any effect on this.
    I tried debugging using a windows file monitor. The library DLL1 is being read from the correct path and is being opened successfully.
    Any suggestions will be greatly appreciated.

  • Linking Error :: Solaris 8 machine with 3rd party libraries

    Hi,
    I am working on a Solaris8 migration project.
    I need an explanation for a problem I have compiling a rather old program I am working with at work. I tried compiling it,
    however I get a bunch of errors of the same type:
    Undefined symbol first referenced in file
    unsafe_ostream::do_opfx(void) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    operator new(unsigned int) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.
    so
    endl(ostream&) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    ws(istream&) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    exthrow /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    RWCString RWLocaleSnapshot::asString(double,int,bool)const ./objs/CalcFinancial.o
    FDRMSCash::FDRMSCash(const RWDBDatabase&,const RWCString&) ./objs/CalcFinancial.o
    RWDBMemTable::~RWDBMemTable() ./objs/CalcFinancial.o
    exalloc /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    ostream::operator <<(double) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    ostream::operator <<(long) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    istream::operator >>(double&) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    istream::operator >>(int&) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    istream::operator >>(long&) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    istream::operator >>(char*) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    Iostream_init::Iostream_init(void) /xenv/RKCurves/sun4/5.x/1.0_A0_beta/lib/librk.so
    FDRMSvsCash::FDRMSvsCash(const RWDBDatabase&,const RWCString&) ./objs/CalcFinancial.o
    RWDBValue&RWDBRow::operator[](unsigned)const ./objs/CalcFinancial.o
    RWDBRow&RWDBMemTable::operator[](unsigned) ./objs/CalcFinancial.o
    RWDecimalPortableInit::RWDecimalPortableInit() ./objs/CalcFinancial.o
    ld: fatal: Symbol referencing errors. No output written to CalcFinancial
    *** Error code 1
    make: Fatal error: Command failed for target `CalcFinancial'
    I can understand that it has to do with linking problems...Compiling is ok..
    I am working on Solaris 8 machine with additional 3rd party libraries like rogue wave etc..
    I have added the library path to the makefile with the -L option & also given the library name with -l option.
    Any help would be appreciated...
    regards
    Debkumar

    I am using FORTE 6 compiler on Solaris 8, & Rogue Wave Source Pro.
    The LINK command is
    $(ALTCC) -mt -library=rwtools7,iostream -staticlib=rwtools7,iostream -lCcFi -lCcDt /xenv/RK
    Curves/sun4/5.x/1.0_A0_beta/lib/librk.a -L/software/development/fdrms/ab83445/src/lib/sun4-5 -lFDRMS
    Calc -L/software/development/fdrms/ab83445/src/lib/sun4-5.5.1 -lFDRMSCalc -ptr$(OBJDIR) -o $@ $(OBJECTS:%=$(OBJDIR)/%)
    The librk.so linking errors can be eliminated if i force it to link the static libraries by including the complete paths to it...
    The errors with CalcFinancial still persists..
    RWCString RWLocaleSnapshot::asString(double,int,bool)const ./objs/CalcFinancial.o
    FDRMSCash::FDRMSCash(const RWDBDatabase&,const RWCString&) ./objs/CalcFinancial.o
    RWDBMemTable::~RWDBMemTable() ./objs/CalcFinancial.o
    FDRMSvsCash::FDRMSvsCash(const RWDBDatabase&,const RWCString&) ./objs/CalcFinancial.o
    RWDBValue&RWDBRow:perator[](unsigned)const ./objs/CalcFinancial.o
    RWDBRow&RWDBMemTable:perator[](unsigned) ./objs/CalcFinancial.o
    RWDecimalPortableInit::RWDecimalPortableInit() ./objs/CalcFinancial.o
    bool RWLocaleSnapshot::stringToNum(const RWCString&,unsigned long*)const ./objs/CalcFinancial.o
    bool RWLocaleSnapshot::stringToNum(const RWCString&,long*)const ./objs/CalcFinancial.o
    FDRMSDebugger::FDRMSDebugger() ./objs/CalcFinancial.o
    bool RWLocaleSnapshot::stringToTime(const RWCString&,std::tm*)const ./objs/CalcFinancial.o
    void DestroyCurves() ./objs/CalcFinancial.o
    FDRMSvsNonCash::FDRMSvsNonCash(const RWDBDatabase&,const RWCString&) ./objs/CalcFinancial.o
    RWDBDatabase::~RWDBDatabase() ./objs/CalcFinancial.o
    RWDBDatabase RWDBManager::database(const RWCString&,const RWCString&,const RWCString&,const RWCStrin
    g&,const RWCString&) ./objs/CalcFinancial.o
    RWDate getValueDate(const RWDBDatabase&) ./objs/CalcFinancial.o
    FDRMSDebugger::~FDRMSDebugger() ./objs/CalcFinancial.o
    unsigned RWDBTable::index(const RWCString&)const ./objs/CalcFinancial.o
    RWCString RWDBValue::asString()const ./objs/CalcFinancial.o
    void closeDatabase(RWDBDatabase&) ./objs/CalcFinancial.o
    unsigned RWDBMemTable::entries()const ./objs/CalcFinancial.o
    bool RWLocaleSnapshot::stringToDate(const RWCString&,std::tm*)const ./objs/CalcFinancial.o
    FDRMSFinancial::FinancialType FDRMSFinancial::convertStringToFinancialType(const RWCString) ./objs/C
    alcFinancial.o
    void CreateCurves() ./objs/CalcFinancial.o
    RWCString arg(RWCString,int,char**) ./objs/CalcFinancial.o
    RWDBMemTable*getRefsByFinclSrcAndBatchStp(const RWDBDatabase&,const RWCString&,const RWCString&,cons
    t RWCString&,const int,const int) ./objs/CalcFinancial.o
    bool RWLocaleSnapshot::stringToMoney(const RWCString&,double*,RWLocale::CurrSymbol)const ./objs/Calc
    Financial.o
    bool FDRMSDebugger::start(const RWCString&) ./objs/CalcFinancial.o
    bool RWLocaleSnapshot::stringToNum(const RWCString&,double*)const ./objs/CalcFinancial.o
    bool RWDBDatabase::isValid()const ./objs/CalcFinancial.o
    ld: fatal: Symbol referencing errors. No output written to CalcFinancial
    *** Error code 1
    make: Fatal error: Command failed for target `CalcFinancial'
    Any help...
    Thanks in advance.
    Deb

  • The struggle of creating a Custom ClassLoader for Native libraries

    Hello Everyone,
    I'm having a really hard time writing and using my own ClassLoader in a Java Applet.
    Context :
    As the this link shows - http://codethesis.com/tutorial.php?id=1 - loading and especially unloading native libraries through Java requires defining our own ClassLoader, and use it to instantiate a class loading a library. When the class using native libraries has finished execution, setting all references to the classloader and calling the garbage collector will cause the native library to be unloaded. The class to load within the custom classloader is thus read byte after byte from the jar and defined using the Classloader.defineClass(..) function. So that's what I did. But I've got two problems.
    Problem 1 :
    On one single machine over 15 tested, the magic number of a given class read from the Jar using Applet.class.getResourceAsStream(classname) takes a value different from CAFEBABE and the defineClass function then throws an "Incompatible magic value" exception (see below). The workaround I found is to force the first 4 bytes of the byte array read from the class with CAFEBABE. But I still would like to understand why it takes a different value on this machine.
    Exception in thread "thread applet-MyApplet.class-1" java.lang.ClassFormatError: Incompatible magic value 409165630 in class file Reader
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at NativeClassLoader.findClass(Unknown Source)
    Problem 2 :
    On windows, the NativeClassLoader works perfectly, but on Linux, I'm getting a java.lang.VerifyError (see below).
    Code is compiled with java 1.6.0_06 on windows XP. I tried to remove everything related to native code (remove .so load), the same error is raised.
    java.lang.VerifyError: (class: Reader, method: <clinit> signature: ()V) Illegal instruction found at offset 1
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    Code :
    NativeClassReader (custom) :
    public class NativeClassLoader extends ClassLoader {
        //the unique instance of the NativeClassLoader
        private static NativeClassLoader instance;
        private NativeClassLoader () {
            super(NativeClassLoader.class.getClassLoader());
         * Get the Singleton instance of the class
        public static NativeClassLoader getInstance () {
            if (instance == null)
                instance = new NativeClassLoader();
            return instance;
        public static void dispose () {
            instance = null;
         * Load a class using its full java name (prefixed with package)
        public Class findClass (String theName) {
            byte[] b = null;
            try {
                b = loadClassDataFromJar(theName);
                Class clazz = defineClass(theName, b, 0, b.length);
                resolveClass(clazz);
                return clazz;
            } catch (Exception e) {
                return null;
         * Gets the bytes of a class file stored in the current jar using
         * its full class name
        public byte[] loadClassDataFromJar (String theName)
                                     throws Exception {
            String filename = "/" + theName.replace('.', '/') + ".class";
            InputStream is = SawsApplet.class.getResourceAsStream(filename);
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            //compute file size
            Vector vChars = new Vector();
            int c;
            while ((c = br.read()) != -1)
                vChars.add(new Byte((byte) c));
            //fill in byte array with chars read from the buffer
            byte[] buff = new byte[vChars.size()];
            //workaround for a bug on one (some) Vista machine(s)
            //force magic number to CAFEBABE instead of 18635F3E
            if (vChars.size() > 3) {
                buff[0] = (byte) 0xCA;
                buff[1] = (byte) 0xFE;
                buff[2] = (byte) 0xBA;
                buff[3] = (byte) 0xBE;
            for (int i = 4; i < vChars.size(); ++i)
                buff[i] = ((Byte) vChars.get(i)).byteValue();
            return buff;
    }Reader (loading native libary) :
    public class Reader {
       static {
         System.loadLibrary("myLib");
        public static native String getData();
    }Main :
        NativeClassLoader cLoader = NativeClassLoader.getInstance();
        Class clazz = cLoader.findClass("Reader"); // ClassFormatError thrown here
        Object reader = clazz.newInstance(); // VerifyError thrown here
        Method m = clazz.getMethod("getData");
        String s = m.invoke(reader);
        print(s);
        s = null;
        m = null;
        reader = null;
        clazz = null;
        cLoader = null;
        NativeClassLoader.dispose();
        System.gcAny ideas would be really appreciated :-)
    Guillaume

    Are you using the executable exe file and the filename as a parameter in the custom task?
    Andreas Baumgarten | H&D International Group

  • Wls 6.1 on solaris 8 intel: native libraries missing (libmuxer.so ...)

    It seems that the native libraries for sparc only are included in WLS 6.1???
    #file libmuxer.so
    libmuxer.so: ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked,
    not stripped
    Where can I get the intel version?
    # ./startWebLogic.sh
    LD_LIBRARY_PATH=/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8
    * To start WebLogic Server, use the password *
    * assigned to the system user. The system *
    * username and password must also be used to *
    * access the WebLogic Server console from a web *
    * browser. *
    Starting WebLogic Server ....
    <Jan 18, 2002 9:57:11 AM CET> <Notice> <Management> <Loading configuration file
    ./config/helsana/config.xml ...>
    <Jan 18, 2002 9:57:17 AM CET> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "sunetweb"
    for domain "helsana">
    <Jan 18, 2002 9:57:22 AM CET> <Notice> <Management> <Starting discovery of Managed
    Server... This feature is on by default, you may turn this off by passing -Dweblogic.management.discover=false>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <Management> <Application Poller not started
    for production
    server.>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <ListenThread listening
    on port 80>
    <Jan 18, 2002 9:57:28 AM CET> <Error> <Performance Pack> <Unable to load performance
    pack, using Java I/O instead.
    Please ensure that libmuxer library is in /usr/j2sdk1_3_1_02/jre/bin/../lib/i386/hotspot:/usr/j2sdk1_3_1_02/jre/bin/../lib/i386::/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8:/usr/lib
    java.lang.UnsatisfiedLinkError: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    ld.so.1: /usr/j2sdk1_3_1_02/jre/bin/../bin/i386/native_threads/java: fatal: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    wrong ELF data format: ELFDATA2MSB
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1419)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1343)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at weblogic.socket.PosixSocketMuxer.<init>(PosixSocketMuxer.java:90)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at weblogic.socket.SocketMuxer.makeTheMuxer(SocketMuxer.java:192)
    at weblogic.socket.SocketMuxer.getMuxer(SocketMuxer.java:144)
    at weblogic.t3.srvr.ListenThread.run(ListenThread.java:232)
    >
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <SSLListenThread listening
    on port 443>

    Hi.
    We only support Solaris on Sparc platforms, so there are no intel libs for Solaris 8.
    Regards,
    Michael
    Dominik wrote:
    It seems that the native libraries for sparc only are included in WLS 6.1???
    #file libmuxer.so
    libmuxer.so: ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked,
    not stripped
    Where can I get the intel version?
    # ./startWebLogic.sh
    LD_LIBRARY_PATH=/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8
    * To start WebLogic Server, use the password *
    * assigned to the system user. The system *
    * username and password must also be used to *
    * access the WebLogic Server console from a web *
    * browser. *
    Starting WebLogic Server ....
    <Jan 18, 2002 9:57:11 AM CET> <Notice> <Management> <Loading configuration file
    /config/helsana/config.xml ...>
    <Jan 18, 2002 9:57:17 AM CET> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "sunetweb"
    for domain "helsana">
    <Jan 18, 2002 9:57:22 AM CET> <Notice> <Management> <Starting discovery of Managed
    Server... This feature is on by default, you may turn this off by passing -Dweblogic.management.discover=false>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <Management> <Application Poller not started
    for production
    server.>
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <ListenThread listening
    on port 80>
    <Jan 18, 2002 9:57:28 AM CET> <Error> <Performance Pack> <Unable to load performance
    pack, using Java I/O instead.
    Please ensure that libmuxer library is in /usr/j2sdk1_3_1_02/jre/bin/../lib/i386/hotspot:/usr/j2sdk1_3_1_02/jre/bin/../lib/i386::/usr2/bea/wlserver6.1/lib/solaris:/usr2/bea/wlserver6.1/lib/solaris/oci816_8:/usr/lib
    java.lang.UnsatisfiedLinkError: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    ld.so.1: /usr/j2sdk1_3_1_02/jre/bin/../bin/i386/native_threads/java: fatal: /usr2/bea/wlserver6.1/lib/solaris/libmuxer.so:
    wrong ELF data format: ELFDATA2MSB
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1419)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1343)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at weblogic.socket.PosixSocketMuxer.<init>(PosixSocketMuxer.java:90)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at weblogic.socket.SocketMuxer.makeTheMuxer(SocketMuxer.java:192)
    at weblogic.socket.SocketMuxer.getMuxer(SocketMuxer.java:144)
    at weblogic.t3.srvr.ListenThread.run(ListenThread.java:232)
    >
    <Jan 18, 2002 9:57:28 AM CET> <Notice> <WebLogicServer> <SSLListenThread listening
    on port 443>--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • JNI Unsatisfied Link Error

    Hello All:
    I have some java code that calls a C function in a dll. I have succesfully used the javah utility to generate the header file for my jni native implementation code and have build both the client java code as well as the dll using g++3.0 using Bloodshed Dev C++ (an open source IDE). When I go to execute the java code I get an unsatisfied link error saying my function is not recognized by the jvm. Does anyone have any suggestions on this issue?? I am using Win2k and jdk 1.4.1
    Here is what I've already tried:
    1) Have added the directory where the java class file as well as the dll to my PATH variable, I have even put the dll files in the jdk bin directory
    2) My dll loads three other dll's and calls a function in one of those dll's, I am using the loadLibrary function to load these dll's and am using function pointers to reference the actual function in the dll
    I was wondering if its a problem if I use g++ to build my dll, does the virtual machine assume by default that gcc is used, please let me know.
    Any help is much appreciated
    Thanks

    I've looked through the various postings on this issue and have tried some or all of the suggestions that were made relevant to my problem but I still keep getting this error. As a result I am attaching some code here:
    Listed below is my java code
    public class DecoderAdapter
    //instance vars
    private static DecoderAdapter decoderAdapObj;
    private String serNum="43543534654";
    private Hashtable decodeInfo;
    private final int DEC_SNTYPE_UNKNOWN=0;
    private final int DEC_SNTYPE_ADOBE_1A=10;
    private final int DEC_SNTYPE_ADOBE_1B=20;
    private final int DEC_SNTYPE_ADOBE_2A=30;
    private final int DEC_SNTYPE_ADOBE_2B=40;
    private int serNumType;
    static
         System.loadLibrary("javaWrapperProj");
    public DecoderAdapter() throws UnsatisfiedLinkError
    /** accessor for decodeInfo
    public Hashtable getDecodeInfoHash()
         return decodeInfo;
    /** mutator for decodeInfo
    public void setDecodeInfoHash()
         initializeHash();
    /** accessor for serial number type
    public int getSerNumType()
         return serNumType;
    /** mutator for serial number type
    public void setSerNumType(int serNumberType)
         serNumType = serNumberType;
    /** accessor for serial number
    public String getSerNum()
         return serNum;
    /** mutator for serial number type
    public void setSerNum(String serNumber)
         serNum = serNumber;
    public static void main(String[] args)
    //local vars
         try
    decoderAdapObj = new DecoderAdapter();
    int snType=decoderAdapObj.DEC_SNTYPE_UNKNOWN;
    String serialNum=decoderAdapObj.getSerNum();
    decoderAdapObj.setDecodeInfoHash();
    Hashtable myHash = decoderAdapObj.getDecodeInfoHash();     
         decoderAdapObj.setSerNumType(decoderAdapObj.DEC_SNTYPE_UNKNOWN);
         int responseCode=decodeSerNum(snType,serialNum,myHash);
         System.out.println("The response from decoding the serial number is "+responseCode);
         System.out.println("About to call the hashtable retrieval function");
         System.out.println("The media code returned="+decoderAdapObj.decodeInfo.get("mediaCode"));
         //getHashResults();
         catch (UnsatisfiedLinkError un)
         System.out.println("Caught an unsatisfied link exception with the message="+un.getMessage());
         System.out.println("The stack trace of this error is="+un.getStackTrace());
    /** This method is used
         to fill up the contents
         of the hashtable
    public void initializeHash()
         decodeInfo = new Hashtable();
         decodeInfo.put("errorCode",new Integer(0));
         decodeInfo.put("mediaCode",new String("temp"));
    //declaration of native method
    private static native int decodeSerNum(int snType,
    String serialNumberStr,
    Hashtable decodeInfoHash);
    The following is what gets generated by the javah utility:
    /* Header for class DecoderAdapter */
    #ifndef IncludedDecoderAdapter
    #define IncludedDecoderAdapter
    #ifdef __cplusplus
    extern "C" {
    #endif
    /* Inaccessible static: decoderAdapObj */
    * Class: DecoderAdapter
    * Method: decodeSerNum
    * Signature: (ILjava/lang/String;Ljava/util/Hashtable;)I
    JNIEXPORT jint JNICALL Java_DecoderAdapter_decodeSerNum
    (JNIEnv *, jobject, jint, jstring, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    And finally the following is my C implementation file:
    Date: 07/11/02 11:56
    Copyright:
    #include <jni.h>
    #include "Decoder.h"
    #include "DecoderAdapter.h"
    #include <iostream.h>
    #include <stdio.h>
    #include <windows.h>
    #include <conio.h>
    typedef int (WINAPI*cfunc)(int,char *,DecodeInfo *);
    JNIEXPORT jint JNICALL Java_DecoderAdapter_decodeSerNum
    (JNIEnv * env, jclass currentObj, jint serialNumberType, jstring serialNumber, jobject decodeInfoHash)
    HINSTANCE hLib=LoadLibrary("WCDSNDecoder.DLL");
    //HINSTANCE hLib1=LoadLibrary("Kernel32.DLL");
    //HINSTANCE hLib2=LoadLibrary("msvcrt.DLL");
    if(hLib==NULL) {
    cout << "Unable to load library!" << endl;
    getch();
    return 0;
    //load the dll at run time
    cfunc decodeSerialNumberPtr=(cfunc)GetProcAddress((HMODULE)hLib, "decodeSerialNumber");
    DecodeInfo result;
    //call decode serial number here
    //and pass in the serial number type
    //the serial number and the empty
    //struct containing the serial number info
    char * actualSerialNumber = const_cast<char *> (env->GetStringUTFChars(serialNumber,0));
    int serType = serialNumberType;
    int finalResult=decodeSerialNumberPtr(serType,actualSerialNumber,&result);
    //set the results from the Decode Info struct
    //int decodeSerialNumber(int serialNumberType,
    // char *serialNumberFrmtd,
    // DecodeInfo *serialNumInformation);
    //first return the Java class object that is the type of the
    //java object
    jclass decoder_class = env->GetObjectClass(currentObj);
    jclass decoder_hash_class = env->GetObjectClass(decodeInfoHash);
    //call the put method from the native code
    //on the hashtable object and pass it the necessary
    //arguements
    jmethodID putMethod = env->GetMethodID(decoder_hash_class,"put","(S,O)V");
    jstring key = env->NewStringUTF("mediaCode");
    jstring value = env->NewStringUTF(result.mediaCode);
    //now do the actual call to the method
    env->CallVoidMethod(decodeInfoHash,putMethod,key,value);
    //release memory here
    FreeLibrary((HMODULE)hLib);
    env->ReleaseStringUTFChars(serialNumber,actualSerialNumber);
    return finalResult;
    The exact error is shown below:
    Caught an unsatisfied link exception with the message=decodeSerNum
    My path variable's contents is shown below:
    PATH=C:\XEmacs\XEmacs-21.4.8\i586-pc-win32;C:\oracle\ora81\bin;C:\oracle\ora81\Apache\Perl\5.00503\bin\mswin32-x86;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Perl\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Perforce;C:\JRE\1.1\bin;c:\webObjectsCode\dev\LocalDeveloper\Executables;C:\djdev\bin;C:\emacs-20.7\bin;C:\jakarta-ant-1.4.1\bin;C:\J2SDK1~1.1\bin;C:\Apple\Library\Executables;C:\Apple\bin;C:\Apple\Library\JDK\bin;C:\j2sdk1.4.1\include;C:\j2sdk1.4.1\include\winnt;C:\webObjectsCode\devWO5\sn_decoder\javaWrapperWork;C:\Program Files\Common Files\Microsoft Shared\VSA\7.0\VsaEnv
    Please note that I am successfully able to build a dll file.
    Any help would be appreciated...

  • Linker errors when linking OCCI 10.1.0  statically on RH AS 3.0 platform

    Hello All,
    I was trying to build an OCCI program on a Red Hat AS 3.0 Update 4 Platform, statically linking to OCCI libraries of Oracle 10.1.0 version. The g++ compiler version is 3.2.3.
    The Makefile and the errors that got generated is mentioned below. However, I could able to build the program when linking through shared library version of OCCI. My requirement is to build the program statically.
    I had been stuck up with this for almost a week and tried checking the previous postings in the forums/newsgroups, but not of much help. I added the following libraries :
    -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10\
    -lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10
    to the Makefile, based on somebody's posting in OCI/OCCI forum. If I didn't provide
    -lpthread I get linker errors in pthread_xxx functions.
    Any help/pointers on this would be really appreciated.
    Makefile (static link)
    ======
    CXX=/usr/bin/g++
    ORA_HOME=/u01/app/oracle/product/10.1.0
    ifndef CXXFLAGS
    # Define C++ compiler flags to locate third-party header files as well as
    # any other options you may want.
    CXXFLAGS=-I${ORA_HOME}/rdbms/demo \
    -I${ORA_HOME}/rdbms/public \
    -I${ORA_HOME}/plsql/public \
    -I${ORA_HOME}/network/public
    endif
    # Include any header files in the current directoryj
    CXXFLAGS:=$(CXXFLAGS) -I . -g -static
    ifndef LDFLAGS
    # Define link paths for Oracle libraries.
    LDFLAGS=-L${ORA_HOME}/lib/ -L${ORA_HOME}/rdbms/lib/
    endif
    LIBS=-locci10 -lclntst10 -lnsl -ldl -lm \
    -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10\
    -lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10 -lpthread
    #LIBS=${ORA_HOME}/lib/libocci10.a ${ORA_HOME}/lib/libclntst10.a -lpthread -ldl
    OCCIPROG=SCDBUtilTest
    OCCIOBJ=SCDBUtil.o SCDBUtilTest.o
    debug: ${OCCIPROG}
    ${OCCIPROG}: ${OCCIOBJ}
    ${CXX} ${CXXFLAGS} -o $@ ${OCCIOBJ} ${LDFLAGS} ${LIBS}
    clean:
    -rm -f $(OCCIPROG) $(OCCIOBJ)
    When ran make, below is the output generated.
    /usr/bin/g++ -I/u01/app/oracle/product/10.1.0/rdbms/demo -I/u01/app/oracle/product/10.1.0/rdbms/public -I/u01/app/oracle/product/10.1.0/plsql/public -I/u01/app/oracle/product/10.1.0/network/public -I . -g -static -c -o SCDBUtil.o SCDBUtil.cpp
    /usr/bin/g++ -I/u01/app/oracle/product/10.1.0/rdbms/demo -I/u01/app/oracle/product/10.1.0/rdbms/public -I/u01/app/oracle/product/10.1.0/plsql/public -I/u01/app/oracle/product/10.1.0/network/public -I . -g -static -c -o SCDBUtilTest.o SCDBUtilTest.cpp
    /usr/bin/g++ -I/u01/app/oracle/product/10.1.0/rdbms/demo -I/u01/app/oracle/product/10.1.0/rdbms/public -I/u01/app/oracle/product/10.1.0/plsql/public -I/u01/app/oracle/product/10.1.0/network/public -I . -g -static -o SCDBUtilTest SCDBUtil.o SCDBUtilTest.o -L/u01/app/oracle/product/10.1.0/lib/ -L/u01/app/oracle/product/10.1.0/rdbms/lib/ -locci10 -lclntst10 -lnsl -ldl -lm -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10 -lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10 -lpthread
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sqmul.o)(.text+0xab): In function `sqmul_dlopen':
    : Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sntp.o)(.text+0x1089): In function `sntpcall':
    : Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sntp.o)(.text+0x10a1): In function `sntpcall':
    : Using 'endgrent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sntp.o)(.text+0xfa1): In function `sntpcall':
    : Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(si.o)(.text+0x14f): In function `sigunmu':
    : Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sniq.o)(.text+0x224): In function `snigun':
    : Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(snlpc.o)(.text+0x1427): In function `snlpcgthstbyad':
    : Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(slputcp.o)(.text+0x245): In function `slputcpsockaddr':
    : Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sgslun.o)(.text+0x2ef0): In function `sgslunGetHostName':
    : Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(snlpc.o)(.text+0xe90): In function `snlpcgthstent':
    : Using 'gethostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(snlpc.o)(.text+0x1945): In function `snlpcgtsrvbynm':
    : Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(snlpc.o)(.text+0x1b8b): In function `snlpcgtsrvbypt':
    : Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(snlpc.o)(.text+0x1702): In function `snlpcgtsrvent':
    : Using 'getservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiStatementImpl.o)(.text+0x6ffb): In function `oracle::occi::StatementImpl::getObject(unsigned int)':
    : undefined reference to `OCIPAnyDataSetFlag'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiResultSetImpl.o)(.text+0xf99): In function `oracle::occi::ResultSetImpl::getBFloat(unsigned int)':
    : undefined reference to `lfpinit'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiResultSetImpl.o)(.text+0x10d9): In function `oracle::occi::ResultSetImpl::getBDouble(unsigned int)':
    : undefined reference to `lfpinit'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiResultSetImpl.o)(.text+0x1ca8): In function `oracle::occi::ResultSetImpl::getObject(unsigned int)':
    : undefined reference to `OCIPAnyDataSetFlag'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiResultSetImpl.o)(.text+0x48b6): In function `oracle::occi::ResultSetImpl::defineConvertBFloat(oracle::occi::ResultSetImpl::Define*, float*, unsigned int*, int)':
    : undefined reference to `lfpinit'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiResultSetImpl.o)(.text+0x49e2): In function `oracle::occi::ResultSetImpl::defineConvertBDouble(oracle::occi::ResultSetImpl::Define*, double*, unsigned int*, int)':
    : undefined reference to `lfpinit'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiTimestamp.o)(.text+0x1aa): In function `oracle::occi::Timestamp::Timestamp(oracle::occi::Environment const*, int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    : undefined reference to `OCIPGetTZI'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiTimestamp.o)(.text+0x256): In function `oracle::occi::Timestamp::Timestamp(oracle::occi::Environment const*, int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    : undefined reference to `OCIPGetTZI'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiTimestamp.o)(.text+0x302): In function `oracle::occi::Timestamp::Timestamp(oracle::occi::Environment const*, int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, std::basic_string<unsigned short, oracle::occi::utext_char_traits, std::allocator<unsigned short> > const&)':
    : undefined reference to `OCIPGetTZI'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiTimestamp.o)(.text+0x3be): In function `oracle::occi::Timestamp::Timestamp(oracle::occi::Environment const*, int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, std::basic_string<unsigned short, oracle::occi::utext_char_traits, std::allocator<unsigned short> > const&)':
    : undefined reference to `OCIPGetTZI'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiTimestamp.o)(.text+0x48a): In function `oracle::occi::Timestamp::do_TimestampConstruct(oracle::occi::Environment const*, int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, void*)':
    : undefined reference to `OCIPGetTZI'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiTimestamp.o)(.text+0xb42): more undefined references to `OCIPGetTZI' follow
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiSQLExceptionImpl.o)(.text+0x91): In function `oracle::occi::SQLExceptionImpl::getNLSMessage(oracle::occi::Environment*) const':
    : undefined reference to `OCIPGetErrorMessageNLS'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiSQLExceptionImpl.o)(.text+0x15b): In function `oracle::occi::SQLExceptionImpl::getNLSUStringMessage(oracle::occi::Environment*) const':
    : undefined reference to `OCIPGetErrorMessageNLS'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x56): In function `oracle::occi::AnyDataImpl::AnyDataImpl(oracle::occi::Connection const*, OCIAnyData*, bool)':
    : undefined reference to `OCIPAnyDataSetUCIOptMode'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x156): In function `oracle::occi::AnyDataImpl::AnyDataImpl(oracle::occi::Connection const*, OCIAnyData*, bool)':
    : undefined reference to `OCIPAnyDataSetUCIOptMode'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x3ae): In function `oracle::occi::AnyDataImpl::AnyDataImpl(oracle::occi::AnyDataCtx const*)':
    : undefined reference to `OCIPAnyDataSetUCIOptMode'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x4e6): In function `oracle::occi::AnyDataImpl::AnyDataImpl(oracle::occi::AnyDataCtx const*)':
    : undefined reference to `OCIPAnyDataSetUCIOptMode'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x780): In function `oracle::occi::AnyDataImpl::setNull()':
    : undefined reference to `OCIPAnyDataSetNull'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x1cc5): In function `oracle::occi::AnyDataImpl::setObject(oracle::occi::PObject const*)':
    : undefined reference to `OCIPAnyDataSetFlag'
    /u01/app/oracle/product/10.1.0/lib//libocci10.a(occiAnyDataImpl.o)(.text+0x2d6f): In function `oracle::occi::AnyDataImpl::getAsObject() const':
    : undefined reference to `OCIPAnyDataSetFlag'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstclo.o)(.text+0x39): In function `lstclo':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstclo.o)(.text+0x52): In function `lstclo':
    : undefined reference to `__ctype_tolower'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstclo.o)(.text+0x6f): In function `lstclo':
    : undefined reference to `__ctype_tolower'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstmclo.o)(.text+0x46): In function `lstmclo':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstmclo.o)(.text+0x5f): In function `lstmclo':
    : undefined reference to `__ctype_tolower'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstmclo.o)(.text+0x7c): In function `lstmclo':
    : undefined reference to `__ctype_tolower'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lxhcnv.o)(.text+0x366): In function `lxhcnv':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lxpname.o)(.text+0xc5): In function `lxpname':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(sl.o)(.text+0x405): In function `sltln':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kge.o)(.text+0x2b19): In function `kgespf':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kge.o)(.text+0x2d12): In function `kgespf':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kgh.o)(.text+0x10d48): more undefined references to `__ctype_b' follow
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kpuini.o)(.text+0x1d70): In function `kpufhndl0':
    : undefined reference to `wtcsrfre'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kpuini.o)(.text+0x7e00): In function `kpuinit0':
    : undefined reference to `wtcsrin'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lcvb24.o)(.text+0x45): In function `lcvb24':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lcvb24.o)(.text+0x9a): In function `lcvb24':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lcvb2w.o)(.text+0x45): In function `lcvb2w':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lcvb2w.o)(.text+0x9a): In function `lcvb2w':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lpu.o)(.text+0x1c5): In function `lpuparse':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lpu.o)(.text+0xf62): more undefined references to `__ctype_b' follow
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstlo.o)(.text+0x44): In function `lstlo':
    : undefined reference to `__ctype_tolower'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstmup.o)(.text+0x43): In function `lstmup':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstup.o)(.text+0x28): In function `lstup':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstup.o)(.text+0x44): In function `lstup':
    : undefined reference to `__ctype_toupper'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lsxv.o)(.text+0x54f5): In function `LsxvParseDecimal':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lsxv.o)(.text+0x6da8): In function `LsxValidateBinary':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lsxv.o)(.text+0x7710): In function `LsxValidateLong':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lsxv.o)(.text+0xb274): In function `LsxvIsLanguage':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lsxv.o)(.text+0xb316): In function `LsxvIsLanguage':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lsxv.o)(.text+0xb3ac): more undefined references to `__ctype_b' follow
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kpucc.o)(.text+0x271): In function `kpuccCacheErr':
    : undefined reference to `wtcLerr'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kpucc.o)(.text+0x2a6): In function `kpuccMainErr':
    : undefined reference to `wtcMerr'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kpucc.o)(.text+0x2e1): In function `kpuccGoRemote':
    : undefined reference to `wtclkm'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(kpucc.o)(.text+0x326): In function `kpuccGetStats':
    : undefined reference to `wtcstu'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lpxbuf.o)(.text+0x2a4f): In function `LpxbufSingleProcess':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(lstmlo.o)(.text+0x43): In function `lstmlo':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(nldt.o)(.text+0x9a1): In function `nldtstr2lv':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(nlfi.o)(.text+0x42f): In function `nlfifpf':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(nlfi.o)(.text+0x462): In function `nlfifpf':
    : undefined reference to `__ctype_b'
    /u01/app/oracle/product/10.1.0/lib//libclntst10.a(nlfi.o)(.text+0x4d4): more undefined references to `__ctype_b' follow
    collect2: ld returned 1 exit status
    make: *** [SCDBUtilTest] Error 1
    Thanks & Regards,
    Karthik D

    Hi ,
    Oh! Anyway, thanks for the information. However, the glibc version I use is glibc-2.3.2-95.30.
    There is a bit of story behind the reason we tried to use static linking. Actually, the application around which we use to develop solutions supports only Oracle 9i. We were developing some components using the C++ SDK provided by application vendor and that components need some information from DB for processing. So, we needed to write a DB class to do that. Since, we found Oracle supports C++ DB interface(OCCI), we thought to use that.
    We had to use RH AS 3.0 platform and the gcc compiler 3.2.x+ for compiling our component code. But Oracle 9i OCCI code doesn't get compiled with gcc/g++ 3.2.x+ compilers. So, we planned to use Oracle 10g OCCI libraries for building the DB class and link it to the custom component we had developed.
    In the run-time environment, we had to install both Oracle 9i clients and Oracle 10g clients since the app requires Oracle 9i and the custom component requires Oracle 10g. We did some kind of tweaking (by providing symbolic links to Oracle 10g OCCI libraries from Oracle 9i client directory) so that both the app and the component gets started.
    I know this is not a good idea. But we didn't want to spend much time on this at that time since we were doing a proof-of-concept. Later, we thought what could be done. We thought ,first we can try lthe custom component linked to static library version of OCCI. That's the reason we tried of static linking.
    The other option is to use OCI interface. But this is a bit of work since we need to write lot of wrapper methods to handle intricacies with OCI and OCI code is cumbersome compared to OCCI.
    Hope now you could have got the problem, I am talking about. Any other better ways?
    Thanks
    Karthik

  • Unsatisfied Link error.

    Hello ,
    I am new to JNI.
    I am getting an Unsatified link error.
    My code is
    public class DisplayMessage {
         static {
               Runtime.getRuntime().loadLibrary("MessaageHandler") ;
                         public static void main(String args[]) {
                                     printMessage() ;
                      public static native void printMessage() ;
    }I have checked the path of my dll. there dont seem to be problem in that. It seems as if the system is not able to find method printMessag() present in the dll.
    Here is the error that I am getting.
    Exception in thread "main" java.lang.UnsatisfiedLinkError: printMessage
         at DisplayMessage.printMessage(Native Method)
         at DisplayMessage.main(DisplayMessage.java:11)Please point me out, what mistake i am doing.

    Hi Oven,
    Thanks for your reply.
    But I have already tried what you had suggested.
    I tried runing my program with the -D option. I have also tried including my dll in the system path.
    I tried running the program after copying my dll at all places like the current directory, Systems directory, The JRE directory, the lib/ext directory and severel other possibl;e places. But still I get the same error.
    I was getting a different error initially which said.
    "No main found in MessageHandler"
    This I suppose I was getting because the path of the Dll was not set properly.
    But now the error is related to the method defined in the dll "printMessage()".
    I have also checked the signature of the method. Everything seems to be fine.
    Please anybody suggest me a way.
    Also If anyone can tell me how I can call a win32 API through java. I hope the way to call a win32 API is the same as calling printMessage() .
    For example I want to call a API InitiateSystemShutDown() in a dll. advapi32.dll.

  • Link Error ...HELLLPPP

    Folk
    I try to create a dll and call within my java code....but I get link error when I try to build my library...
    here is how I call the library:
    .java file
    qcSys(command, byteImgLocal);
    public native void qcSys(String command, byte[] byteImgLocal);
    static
    System.loadLibrary("qcSys");
    .h file machine genrated
    JNIEXPORT void JNICALL Java_SrDesign_qcSys(JNIEnv *, jobject, jstring, jbyteArray);
    .c file
    #include <StubPreamble.h>
    #include <stdio.h>
    #include "SrDesign.h"
    void SrDesign_qcSys(struct HSrDesign *this,
    struct Hjava_lang_String command, HArrayOfByte byteImage)
    char *QCimage = unhand(byteImage)->body;
    int length = obj_length(byteImage);
    FILE *fp;
    fp = popen(makeCString(command),"r");
    fgets(QCimage, length, fp);
    return;
    now when I build the project in MVC++ 6 on windows 2000 I get bellow messages
    warnning on line fp=popen(makeCString (command), "r");
    1. 'popen' undefined; assuming extern returning int
    2. 'makeCString' undefined; assuming extern retruning int
    3. '=' : 'struct_iobuf *' differs in levels of indirection from int
    linking...
    qcSys.obj : error LNK2001 : unresolved external symbold _popen
    qcSys.obj : error LNK2001 : unresolved external sysmbol _makeCString
    Error executing link.exe
    can somebody helllllp me please! I'm not familiar with MVC++

    now when I build the project in MVC++ 6 on windows
    2000 I get bellow messages
    warnning on line fp=popen(makeCString (command),
    "r");When you get warning you better pay attention to them.
    1. 'popen' undefined; assuming extern returning intThis says that the compiler does not know what function 'popen' is.
    Given that the method looks a lot like 'fopen' I question where you got it from.
    Note that even though the compiler has no idea what you are talking about it has no problem compiling with a best guess.
    2. 'makeCString' undefined; assuming extern retruning
    intAgain the function is not defined. You need to figure out what it is.
    3. '=' : 'struct_iobuf *' differs in levels of
    indirection from int
    linking...Bad, bad, bad idea to ignore any error that has anything to do with pointers.
    Best guess you are not accessing this correctly.
    qcSys.obj : error LNK2001 : unresolved external
    symbold _popenEither you misspelled the name or you need to find your library that has this (it is not a C/C++ method.)
    qcSys.obj : error LNK2001 : unresolved external
    sysmbol _makeCString
    Error executing link.exe
    Same thing as above.

  • C++ newbie gets linking error

    Hi,
    I am writing my first C++ programs (been a SQL/DB programmer for last 10 years) on Sun Solaris. Here is my source code:
    #include <list>
    #include <string>
    #include <iostream.h>
    using namespace std; // You must use this to include STL!
    int main()
    // Create list instances
    list<int> list1; // Empty list
    size_t n = 10;
    double val = 3.14;
    list<double> list2(n, val); // Create n copies of val
    list<double> list3(list2); // Create a copy of list2
    cout << "Size of list1 " << list1.size() << endl;
    cout << "Size of list2 " << list2.size() << endl;
    cout << "Size of list3 " << list3.size() << endl;
    // We iterate over the elements of list 3 and print its elements
    // Create list iterator
    list<double>::const_iterator i;
    // Print every character in the list
    for (i = list2.begin(); i != list2.end(); ++i)
    cout << *i << ",";
    and getting the following linker error:
    /SUNWspro/9.0/exec/SUNWspro/bin/CC -o test test.cpp
    Undefined first referenced
    symbol in file
    std::bad_alloc::bad_alloc() test.o
    void*operator new(unsigned,void*) test.o
    ld: fatal: Symbol referencing errors. No output written to test
    I have heard of Solaris C++ compilers having problem with the use of templates..... is this the problem here or am I just missing some arguments/libraries?
    Thx in advance!

    In the interest of keeping code examples short and simple, textbook authors do things in their code examples that are not suitable for real-world applications. Apart from "using namespace std", you find global variables and functions with short names, and no attention paid to error detection or recovery. (They also use more explanatory comments in the code than a real-world program should have.)
    That's OK when you are illustrating particular language points. You want to highlight the point, and not have a lot of distractions. But in my view, not enough authors go on to explain good programming practice, and show realistic examples.
    For the case in point, the Standard Library declares thousands of names. They are in namespace std to help avoid collisions with user-defined names. Once you put "using namespace std" into your code, you import all of those names into the global namespace, creating opportunities not only for compiler complaints due to name collisions, but for subtle errors involving binding symbols to the standard library that you expected to refer to your own definitions.
    I never write "using namespace std" in real code. I sometimes use it when creating tiny test cases for bug reports. But as you saw in my earlier comments, the difference in the sample program between a dangerous programming practice and a much better programming practice was one line of code!

  • Help !! a link error

    when I link my application to an lib. the following link error occurs:
    Undefined first referenced
    symbol in file
    __RTTI__1CpknKDT_TSymbol4nJRWCString___ /am/lib/sun4.solaris2.9/libDV.so
    How can I get the information about the symbols in a lib?
    I'm not sure where the symbol __RTTI__1CpknKDT_TSymbol4nJRWCString is defined?

    I see that this forum software deleted the stuff in angle brackets in my original answer. The missing RTTI symbol refers to const DT_TSymbol< RWCString >* That is, a pointer to template class DT_TSymbol instantiated on type RWCString.
    The missing symbol is a data object generated by the compiler. Since the data object is referenced in each shared library, it should be contained in each shared library.
    The RTTI data is missing, and there are at least two reasons why that might be so.
    1. The library was not built correctly; a necessary object file was omitted. That missing object file would have contained the RTTI data.
    2. The library was built with a compiler that neglected to emit the RTTI object (a compiler bug).
    Determining which is the case is beyond the scope of what we can do in this forum.
    A place to start is to have whoever built those libraries add the option "-z defs" to the CC command line that was used to create each shared library. They will see linker error messages about all the needed symbols that are missing. That's a starting point for tracking down why they are missing.
    In general, shared libraries should be built with "-z defs" so that the creator of the library finds out about missing symbols instead of inflicting the pain on clients of the library.

  • Strange Linker error using Forte 6

    Hi,
    I am getting an unusual linker error while trying to compile something using Forte 6 update 2. First some backgrond
    We have an internal application currently running on a Solaris 2.6 box. I wish to move it to a Solaris 8 box. The application uses mainly apache, perl and mysql. One of the perl modules used is the old SPGrove module written by James Clark (www.jclark.com), which in turn uses the libsp.a library from the 'sp' distribution by the same author. I can find information on compiling/running 'sp' on O/S versions upto solaris 7 but not 8. Having tried all the available versions of gcc I finally gave up and tried Forte 6.
    Having had problems with applications and dynamic libraries complied with different compilers before I have compiled perl 5.6.1 using Forte 6, I have installed all the required perl modules and I have successfully compiled version 1.3.4 of the 'sp' package.
    The old SGML::SPGrove modules is no longer available and has been replaced by two newer ones, SGML::Grove, which installs fine, and SGML::SPGroveBuilder, which has some C++ code which is linked against the libsp.a library as mentioned above. The module (once certain options have been set to get the correct environment) compiles fine but when I run the test suit I get the following error.
    Can't load 'blib/arch/auto/SGML/SPGroveBuilder/SPGroveBuilder.so' for module SGML::SPGroveBuilder: ld.so.1: /usr/local/bin/perl: fatal: relocation error: file blib/arch/auto/SGML/SPGroveBuilder/SPGroveBuilder.so: symbol __1cG__CrunLvector_copy6Fpv1IIpF11_vpF1_v_v_: referenced symbol not found at /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206.
    The symbol '__1cG__CrunLvector_copy6Fpv1IIpF11_vpF1_v_v_' is contained in libCrun.so in the Forte installation. I have no idea what it is, or why I get the error.
    Sorry to be so long winded, but I wanted to give enough information so that I didnt get 'too many' easy to answer questions about the environment.
    'uname -snrvmapiX' for the system is:
    SunOS atlas 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-60System = SunOS
    Node = atlas
    Release = 5.8
    KernelID = Generic_108528-13
    Machine = sun4u
    BusType = <unknown>
    Serial = <unknown>
    Users = <unknown>
    OEM# = 0
    Origin# = 1
    NumCPU = 1
    Many thanks.
    Sean Timmins
    Systems Administrator

    Just to clarify, the I get the error during the 'make test' part of the normal perl module build process for installing the SGML::SPGroveBuilder module (perl Makefile.PL; make; make test; make install).
    Perl and SGML::SPGroveBuilder are both complied using Forte 6 update 2. The only difference being that perl (being normal C code) was compiled using the C compiler '/usr/local/SUNWspro/bin/cc' and the module requires the C++ complile '/usr/local/SUNWspro/bin/CC'.
    I have to make minor modifications to Makefile.PL before it will compile at all. These modifications are:
    1) Forcing the C++ compiler as perl will try to use exactly the same binary as was used to compile itself.
    2) Setting a few #define's so that the same ones are used to build the module as were used to build the sp library that is linked in with the module.
    3) Adding the various directories where both libsp.a (yes statically linked, no dynamic one in the sp distribution) and the required header files (all in the sp distribution) are located.
    I have since tried recompiling perl (with Forte 6 update 2) with no dynamicaly loaded libraries and get the same error. I have also found a tiny little patch to OpenSPv1.5pre5 (which is the replacement for the original sp distribution) which allowed me to compile eveything with gcc 3.1, perl, opensp (v1.5pre5) and SGML::SPGroveBuilder, and I get a very similar error at the same stage but a different symbol name.
    I am begining to think that its gone to far and there are too many branching oppertunities where I have made a mistake (I've really tried way way way too many combinations now), or that the SPGroveBuilder module simply has a probelm with the C++ code in it. It has not been updated in some time.
    I am going to try removing everything from the box and start from scratch, patch it to the hilt and try it from the beginning.
    Of course, any flashes of brilliance that come to mind would still be greatly appreciated :-)
    Sean Timmins
    Systems Administrator

  • Linker error Multiple definitions for symbol

    Hi,
    I have ported a project from Linux-based DAQmx to LabWindows CVI 2012 on a PXI machine. After making all conversion requirements, and successfully compiling, I am getting tons of the following linker errors for various modules files (just pasting
    a subset of those here):
    Multiple definitions for symbol '_PtrToPtr64' in modules X and Y
    Multiple definitions for symbol '_Ptr64ToPtr' in modules Z and Y
    Multiple definitions for symbol '_HandleToHandle64' in modules X and Y
    Multiple definitions for symbol '_HEAP_MAKE_TAG_FLAGS' in modules X and Y
    Multiple definitions for symbol '_TpInitializeCallbackEnviron' in modules X and Y
    I found this relevant post: http://forums.ni.com/t5/LabWindows-CVI/CVI2010-clang-link-errors-with-Windows-SDK/td-p/1425690
    which points to a known issue in CVI 2010. However the workaround (enabling C99 build option) is already set in my project, so this solution does not apply.
    Any idea what could be causing these windows.h symbols to get redefined?
    Thank you
    Solved!
    Go to Solution.

    Anjelica-W wrote:
    Can you run other examples that are accessing the Windows SDK without linker errors?
    You can also try adding import libraries for functions that are not automatically linked as suggested in this KnowledeBase article.
    Thanks for your reply. Yes I can run some basic apps that use windows.h without these linker errors, but cannot figure out the difference with mine. One more thing that could help diagnose the issue: Some of these fuctions are defined in file basetsd.h
    located in CVI2012\sdk\include, an excerpt of that code is below, which seems to be added by CVI. Is it possible that these are also defined somewhere else, causing the conflict? How can I see the linker options in CVI and find the path that it searches for libraries to link?
    // ADDED TO BY CVI
    #if !(defined (_CVI_) && defined (_INTERACTIVE_WINDOW_BUILD_))
    __inline
    void * POINTER_64
    PtrToPtr64(
    const void *p
    return((void * POINTER_64) (unsigned __int64) (ULONG_PTR)p );
    __inline
    void *
    Ptr64ToPtr(
    const void * POINTER_64 p
    return((void *) (ULONG_PTR) (unsigned __int64) p);
    __inline
    void * POINTER_64
    HandleToHandle64(
    const void *h
    return((void * POINTER_64)(__int64)(LONG_PTR)h );
    __inline
    void *
    Handle64ToHandle(
    const void * POINTER_64 h
    return((void *) (ULONG_PTR) (unsigned __int64) h );
    #endif /* _CVI_ */

  • Linker error 2005 when using member variable of type CNiGraph in CW++

    Hi,
    when I try to use a member variable of type CNiGraph I receive linker errors LNK2005, e.g.:
    msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __CrtDbgReport already defined in libcmtd.lib(dbgrpt.obj)
    The project was created with the NI Measurement AppWizard.
    CW Version 3.0.1(549)
    OS: Windows 2000
    Thank you for your help.
    Uwe Gratzke

    This really isn't enough info about your project to give a definative answer, but one possibility is that you could have set up your project to be statically linking to the MFC libraries which we don't support. It could be a lot of other possibilities also. If you would like, you could have our support engineers help you with the project by sending it to us via http://www.ni.com/ask.
    Best Regards,
    Chris Matthews
    Measurment Studio Support Manager

  • Linker error while packaging iOS app with my ANE

    While trying to write a iOS Native Extension for ZXingObjC (https://github.com/TheLevelUp/ZXingObjC), the following link error shows up when exporting in Flash Builder 4.x:
    Error occurred while packaging the application:
    Undefined symbols for architecture armv7:
      "___divmodsi4", referenced from:
          +[ZXEncoder numDataBytesAndNumECBytesForBlockID:numDataBytes:numRSBlocks:blockID:numDataBytesInBlock: numECBytesInBlock:error:] in libcom.google.zxing.ZXingNativeExtension.a(ZXEncoder.o)
          +[ZXAztecEncoder encode:len:minECCPercent:] in libcom.google.zxing.ZXingNativeExtension.a(ZXAztecEncoder.o)
          +[ZXAztecEncoder generateCheckWords:totalSymbolBits:wordSize:] in libcom.google.zxing.ZXingNativeExtension.a(ZXAztecEncoder.o)
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    This happens in Flash Builder 4.6 or 4.7 using AIR SDK 3.7
    This isn't my first Native Extension for iOS. No amount of fiddling around with adding frameworks or libraries in Xcode to the static library works.
    Looking for guidance on what to try next to resolve this linker error...

    I am also receiving an error related to ___divmodsi4 (using different libraries which use that symbol) which appears to be a compiler level math function. It should be packaged automatically but apparently AIR isn't doing it.  No idea what additional library should be linked, attempts to link the 3rd party libraries (and/or packagedDepenency them) failed.
    Undefined symbols for architecture armv7:
      "___divmodsi4", referenced from: (methods in a third party library)
    My Platform.xml is as such:
    <platform xmlns="http://ns.adobe.com/air/extension/3.7">
        <sdkVersion>6.0</sdkVersion>
        <linkerOptions>
        <option>-ObjC</option>   
        <option>-weak_framework Accounts</option>
        <option>-framework AddressBook</option>
        <option>-framework AddressBookUI</option>
        <option>-weak_framework AdSupport</option>
        <option>-framework CoreAudio</option>
        <option>-framework CoreLocation</option>
        <option>-framework CoreMotion</option>
        <option>-framework CoreTelephony</option>
        <option>-framework EventKit</option>
        <option>-framework EventKitUI</option>
        <option>-framework iAd</option>
        <option>-framework MapKit</option>
        <option>-framework MediaPlayer</option>
        <option>-framework MessageUI</option>
        <option>-framework OpenAL</option>
        <option>-weak_framework PassKit</option>
        <option>-framework StoreKit</option>
        <option>-weak_framework Twitter</option>
        <option>-framework UIKit</option>
        <option>-lsqlite3</option>
        <option>-lxml2</option>
        <option>-lz</option>
        </linkerOptions>
    </platform>
    If the author or anyone manages a solution, please post it in this thread!

Maybe you are looking for

  • K7D Master-L MS-6501 computer locks up when transferring data to external HD

    I'm not 100% sure the problem is with the motherboard, but I think I've narrowed it down to the point that the MB could be the problem, and so I figured it was worth a shot to see if anyone else had heard of this problem or perhaps had any suggestion

  • Unable to open Bootcamp install of Vista after upgrading MacBook Pro / Mid 2010 to OS Mavericks

    Dear Community, I am unable able to boot the Windows Vista install (via Boot Camp) on my MacBook Pro / mid 2010 after upgrading to OS Maverick. Any idea about how this problem can be solved (I don't want to purchase Windows 7 and I don't want to purc

  • Production against sales order

    Hi all experts, I am creating a report for Linewise width wise handover summary(OK production against sales order) I am taking Date from MKPF and QTY from MSEG I need to show Work Center [ CRHD-ARBPL ] but dont know how to link tables can any one sen

  • Weird error in default log

    Any idea what this is. In checking with colleagues who might run reconstruct, no one had... Does it run automatically? It seems to have failed, perhaps crashing and the restarting the store? We are running 6.3-5.02. (120228-25/Solaris Sparc). [12/Jun

  • Terminate state machine

    Attachment is the simple state machine i did and for ur better understanding. I have a state machine and which initially is at case "wait". After pressed the start button, it go to case "First" which sum the values and then got to case "Second" which