Linking error - JNI code

Hi
I am new to JNI.
I am getting linking error as below:
--------------------Configuration: InvokeJava - Win32 Debug--------------------
Compiling...
invoke.c
invoke.obj : error LNK2001: unresolved external symbol __imp__JNI_CreateJavaVM@12
invoke.exe : fatal error LNK1120: 1 unresolved externals
Error executing cl.exe.
InvokeJava.exe - 2 error(s), 0 warning(s)
Please help me.
Code is pasted below:
#include<stdlib.h>
#include <jni.h>
#define PATH_SEPARATOR ';' /* define it to be ':' on Solaris */
#define USER_CLASSPATH "." /* where Prog.class is */
main() {
     JNIEnv *env;
     JavaVM *jvm;
     jint res;
     jclass cls;
     jmethodID mid;
     jstring jstr;
     jclass stringClass;
     jobjectArray args;
#ifdef JNI_VERSION_1_2
     JavaVMInitArgs vm_args;
     JavaVMOption options[1];
     options[0].optionString =
          "-Djava.class.path=" USER_CLASSPATH;
     vm_args.version = 0x00010002;
     vm_args.options = options;
     vm_args.nOptions = 1;
     vm_args.ignoreUnrecognized = JNI_TRUE;
     /* Create the Java VM */
     res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
#else
     JDK1_1InitArgs vm_args;
     char classpath[1024];
     vm_args.version = 0x00010001;
     JNI_GetDefaultJavaVMInitArgs(&vm_args);
     /* Append USER_CLASSPATH to the default system class path */
     sprintf(classpath, "%s%c%s",
          vm_args.classpath, PATH_SEPARATOR, USER_CLASSPATH);
     vm_args.classpath = classpath;
     /* Create the Java VM */
     res = JNI_CreateJavaVM(&jvm, &env, &vm_args);
#endif /* JNI_VERSION_1_2 */
     if (res < 0) {
          fprintf(stderr, "Can't create Java VM\n");
          exit(1);
     cls = (*env)->FindClass(env, "Prog");
     if (cls == NULL) {
          goto destroy;
     mid = (*env)->GetStaticMethodID(env, cls, "main",
          "([Ljava/lang/String;)V");
     if (mid == NULL) {
          goto destroy;
     jstr = (*env)->NewStringUTF(env, " from C!");
     if (jstr == NULL) {
          goto destroy;
     stringClass = (*env)->FindClass(env, "java/lang/String");
     args = (*env)->NewObjectArray(env, 1, stringClass, jstr);
     if (args == NULL) {
          goto destroy;
     (*env)->CallStaticVoidMethod(env, cls, mid, args);
destroy:
     if ((*env)->ExceptionOccurred(env)) {
          (*env)->ExceptionDescribe(env);
     (*jvm)->DestroyJavaVM(jvm);
}

Hi,
you have to link jni.lib with your code. This lib is contained in the lib subdirectory of your JDK. Add jni.lib to the list of libraries and don't forget to add the directory where jni.lib is located to the library search path.
Martin

Similar Messages

  • Error ref code: tuMfkgFG8GvC0T4olRZOeA

    Hi!
    We are getting this error code in Adobe forms questionnaire we created whenever a user hits the "Save" feature button
    Unable to send form link
    error ref code: tuMfkgFG8GvC0T4olRZOeA
    Can someone please help?
    The form is online and located here: http://systemise.com.au/web-design-questionnaire/
    You can try and replicate.
    Thank you!
    Tony

    Your form data has been saved.
    Please click the button within 7 days to complete and submit your form:
    Retrieve Form
    or click on the link below:
    http://systemise.com.au/web-design-questionnaire/#_%40%40rdd%3DjjPI0XSCKCDMvdp7549HEABwFDd Vr3DRbbeEuM7ZdMfXrMHbITayg40f2hjY8whWA
    If you cannot access this link, copy and paste the entire URL into your browser.
    Note: After 7 days your saved form will be discarded.
    So I clicked the link then it will just pop on the screen and I cant do anything on the form!!!

  • 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...

  • JNI Unsatified 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
    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
    Any help is much appreciated
    Thanks

    When I go to execute the java code I get an unsatisfied link error
    saying my function is not recognized by the jvm.Presumably this means that you loaded the dlls successfully.
    Which means that the shared lib path, at least for those dlls, does not matter. The path only matters when the dll fails to load.
    So you are getting this when the native method is actually called.
    The reason is because the signatures do no match. Java is calling a JNI method and that exact method is not in the dlls that you have loaded.
    Possible reasons:
    -You didn't use javah correctly (has to do with packages.)
    -You added a package and didn't rerun javah to get the new signature.
    -You changed the package and didn't rerun javah to get the new signature.
    -You manually modified the signature so it no longer matches the one generated by javah.
    -You are using an unusual set of compiler options which causes the compiler to modify the signature.
    -You are loading the wrong dll.

  • Jni - unsatisfied link errors in packages

    I am trying to run a test Java program that uses JNI in Win2k. I only have two classes, so I am experimenting with putting them in a package. When I do that I get unsatisfied link errors at runtime that I don't get when they are not in a package.
    I don't get exceptions on the loadLibrary call, for some reason, only when I make a call to the native code.
    Any ideas??? Speculations? Do I need to set some sort of path env variable, other than "path" to find the library (like Unix)? I'm new at this windows stuff.
    Thanks in advance ...
    Maggie

    I got it! I needed to put the package name in front of the class name in the C file.

  • Error in linking C++ STL code  using CC 5.0 on Solaris 2.6

    Hi All,
    When building a shared dynamic library from C/C++ code using
    STL features, I get an a link error, referring to the STL objects in
    use.
    I use CC WorkShop C++ Compiler 5.0 running on Solaris 2.6.
    For example:
    using a vector<int> we get :
    Undefined Symbol
    __1cDstdGvector4Cin0AJallocator4Ci___M__insert_aux6Mpirki_v_
    In File aaa.o
    using a multimap<int,int> we get :
    Undefined Symbol
    __1cH__rwstdJ__rb_tree4CinDstdEpair4CkiCi__n0AL__select1st4n0C_Ci__n0BEless4Ci__n0BJallocator4n0C____U__deallocate_buffers6M_v_
    In File aaa.o
    etc.
    Switching (for testing) from shared lib to an exe does not seem
    to solve this issue.
    Same goes for toggling libCstd & libCrun's link mode (dyn/stat).
    Any suggestions would be appreciated!
    Thank you,
    Gilad

    Hi Gilad,
    I have a suggestion concerning the std::vector::__insert_aux error:
    http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5069680
    Some recommended link options are provided in:
    http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5104725
    Hope this is useful.
    Bye.

  • I am getting an linker error LNK2001 : unresolved symbol _main while compiling Microsoft c code

    I am writng a simple application in C language for communicating with GPIB. when I compile the c file I am getting a linker error
    LIBC.lib(ctr0.obj): LNK2001 error: unresolved sysmbol _main
    I compile the application in the dos window using the command
    cl gpibApplication.c gpib-32.obj.
    Could anyone tell me how to remove this error

    Hello-
    It sounds like the main function is missing from the gpibApplication.c file. Be sure that the following function is somewhere in the code:
    int main (int argc, char *argv[])
    Also, note that this function is case sensitive, so be sure main is not capitalized.
    Randy Solomonson
    Application Engineer
    National Instruments

  • An error encounter on test devise (real devise) i.e "apple mach -o linker error linker command failed with exit code 1", please any body help me to solve the problem

    Hello, I am using tesseract api in my app, which run perfectly on simulator but on test devise (real devise) it is showing an error i.e "apple mach -o linker error linker command failed with exit code 1", please any body help me to solve the problem

    if you can't compile the webutil.pll in your forms developer you need to set the forms_builder_classpath in you windows registry. You have to add the frmwebutil.jar,jacob.jar to the registry key. The configuration files you mention are for running the forms.

  • Getting Linker errors while porting InDesign CC plugin code to InDesign CC 2014

    Hello,
    I am getting following linker errors during porting of plugin code from InDesign CC to InDesign CC 2014
    > PlugInStatics.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ)
    > PlugInStatics.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??__Enative_ecat@system@boost@@YAXXZ)
    I am using following environment :
    OS : Windows 7 SP1 (64bit)
    Visual Studio : VS 2013 with platform tool set = Visual Studio 2010 (v100)
    InDesign SDK : InDesign CC 2014 plugin SDK (070)
    Boost Libraries : 1.55
    I have added external boost library paths in visual studio -> Linker properties -> Additional Library paths, still above linker errors persists, can someone help ?
    Thanks,
    -Harsh.

    Hello Bartek,
    Your answer resolved similar linker errors I faced while porting InDesign plug-ins from CC to CC 2014.
    I added the macro - BOOST_SYSTEM_NO_DEPRECATED to the Preprocessor Definitions in VS 2012 SP4 and the build succeeded.
    The second option of adding the macros - BOOST_ALL_DYN_LINK;BOOST_REGEX_USE_CPP_LOCALE;BOOST_REGEX_RECURSIVE;BOOST_HAS_ICU=1;BOOST_ FILESYSTEM_VERSION=3;BOOST_CHRONO_HEADER_ONLY;BOOST_SIGNALS_NO_DEPRECATION_WARNING; did not work for me.
    Can you explain why this linker error showed up? And how the macro solved it?
    Thanks,
    Vijayasri

  • Gettling linker error:LNK2001 while porting InDesign CS6 plugin code to InDesign CC plugin

    Hello,
    I am working on porting our existing InDesign CS6 plugin code to support InDesign CC plugin (client plugin on Windows platform)
    The plugin code gets compiled successfully after makeing neccessory code (API) changes but now gettling following linker error
    StackListBoxTVWidgetMgr.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall NodeID::GetNodeType(void)const " (__imp_?GetNodeType@NodeID@@QBEJXZ)
    IBClientPluginDialogController.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall DVHostedWidgetEH::AddRef(void)const " (?AddRef@DVHostedWidgetEH@@UBEXXZ)
    I have checked every configuration setting, all the paths to include headers and static libraries are pointing to InDesign CC SDK.
    Note : Getting these linker errors in all the UI component class objects where following interfaces are inherited :
    CTreeViewWidgetMgr
    CIDEditBoxEventHandler
    etc.
    Build Environment :  Windows 7 ultimate + Visual Studio 2010 SP1 + InDesign CC Products SDK Build 244

    Try including DV_WidgetBin.lib.

  • Build Collada DOM 2.2 in X-Code and got _unZOpen, Close a link errors

    I am trying to build Collada DOM 2.2 in XCode and getting following link error.
    Collada DOM is providing minizip (library) which contains zip.h and unzip.h, which is called after calling mac libraries; Is any way I can specify in XCode project build specifications to read minizip from Collada first?
    Building target “viewer” of project “viewer” with configuration “Debug” — (8 errors)
    "_unzGoToNextFile", referenced from:
    daeZAEUncompressHandler::extractArchive(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzGetCurrentFileInfo", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzCloseCurrentFile", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzOpenCurrentFile", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzReadCurrentFile", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzGetGlobalInfo", referenced from:
    daeZAEUncompressHandler::extractArchive(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzClose", referenced from:
    daeZAEUncompressHandler::~daeZAEUncompressHandler()in libdom.a(daeZAEUncompressHandler.o)
    "_unzOpen", referenced from:
    daeZAEUncompressHandler::daeZAEUncompressHandler(daeURI const&)in libdom.a(daeZAEUncompressHandler.o)
    Your help greatly appreciated.
    Thanks

    Please look into following link
    https://sourceforge.net/forum/forum.php?threadid=2643729&forumid=531263

  • C-Linker Error - can't find JNI Methods

    Hi
    I'm trying to exchange data from Java to C via Byte-Arrays. The
    .c-file compiles fine but I get an error while linking:
    Link Error : Undefined symbol: _GetByteArrayRegion in
    LBCCODEC.C
    Link Error : Undefined symbol: _SetByteArrayRegion in
    LBCCODEC.C
    I'm using the SetByte..- method the following way:
    SetByteArrayRegion(env, encodedArr, 0, 26, Line);
    Data types used here are: JNIEnv *env, jbyteArray encodedArr; char Line[26] ;
    thank you for your suggestions.

    issue resolved already! thx anyway

  • C Code NI-VISA linker error

    I wrote the following C command to pass SCPI commands to Rohde&Schwarz FSL
    #define NIVISA_PXI
    #include <visa.h>
    #define MAX_CNT 200
    int main(void)
    ViStatus status; /* For checking errors */
    ViSession defaultRM, instr; /* Communication channels */
    ViUInt32 retCount; /* Return count from string I/O */
    ViChar buffer[MAX_CNT]; /* Buffer for string I/O */
    status = viOpenDefaultRM(&defaultRM);
    if (status < VI_SUCCESS)
    return -1;
    status = viWrite(instr, "*RST", 6, &retCount);
    status = viClose(instr);
    status = viClose(defaultRM);
    return 0;
    I am getting linker errors.   [Linker error] undefined reference to `viOpenDefaultRM@4' 
    I use Bloodshed Dev C++ . I have included the header files from the VXIPNP folder to the include folder od Dev C++. It had 11 files.it had 4 header files visa.h, visatype.h, vpptype.h and rsfsp.h
    Do i need to install any header file or libraries? Please help, this is the first time I am using VISA.H 
    Solved!
    Go to Solution.

    [root@localhost raavan]# gcc main.c -L /usr/local/lib/libvisa.so
    /tmp/ccKHyQta.o: In function `sendscpi':
    main.c: (.text+0x2e): undefined reference to `viWrite'
    /tmp/ccKHyQta.o: In function `main':
    main.c: (.text+0x52): undefined reference to `viOpenDefaultRM'
    main.c: (.text+0x99): undefined reference to `viOpen'
    main.c: (.text+0xbb): undefined reference to `viSetAttribute'
    main.c: (.text+0xd9): undefined reference to `viClose'
    main.c: (.text+0xeb): undefined reference to `viClose'
    collect2: ld returned 1 exit status
    contents of main.c are:
     #include "visa.h"
    #include "stdio.h"
    #include "string.h"
    #define MAX_CNT 200
    char scpi[50]; /*To store the SCPI commands*/
    ViStatus status; /* For checking errors */
    ViSession defaultRM, instr; /* Communication channels */
    ViUInt32 retCount; /* Return count from string I/O */
    ViChar buffer[MAX_CNT]; /* Buffer for string I/O */
    void sendscpi (char *s)  
         status = viWrite(instr, (ViBuf)s, strlen (s), &retCount);
    int main(void)
    /* Begin by initializing the system*/
    status = viOpenDefaultRM(&defaultRM);
    if (status < VI_SUCCESS) {
    return -1;
    /* Open communication with TCPIP Device at Primary Addr FSL (192.168.186.107)*/
    status = viOpen(defaultRM, "192.168.186.107", VI_NULL, VI_NULL,&instr);
    /* Set the timeout for message-based communication*/
    status = viSetAttribute(instr, VI_ATTR_TMO_VALUE, 5000);
    /* Send SCPI commands for the test case */
    sendscpi ("*RST" ) ;
    /* Close down the system */
    status = viClose(instr);
    status = viClose(defaultRM);
    return 0;
    Please help!
    Message Edited by rohit_rs on 03-12-2009 07:04 AM
    Message Edited by rohit_rs on 03-12-2009 07:04 AM

  • NiseCfg library link errors - will not compile working code on replicate system

    i have working software trying to install on a replicate system.    it does not compile on the replicate system.   the problem is nise, niseCfg link errors  for example:  
    Undefined symbol:  '_niseCfg_GetVirtualDeviceProperty@20' referenced in "TestSystem_Config.c"
    originally it complained it couldn't find the nise.h and niseCfg.h header files.   i copied the header and some other object and fp files (yeah, yeah, i know :-/ from my working system to the replicate system (in the NI/Shared/CVI directory path).
    it then found the header file and prototypes but now the undefined link errors.   i have nise.dll in my WIndows System directory.
    Please help.   what do i do to fix this?   thanks!

    The CVI IDE needs to know someway where to find the resources your program is using and this can be done in several ways. One of them is loading the instruments in the Instrument menu: this is valid if your instrument is used in only one project of yours or a few one. Another method, which is useful for insrtument you use intensively in all your projects, is to add them to the Library menu (option Customize...): this will make your libraries and FPs available for every project you are working on without need to explicitly add the instruments to the Instrument menu.
    If you are using an instrument and you don't see it in the project it must be loaded in one of the ways I described before: you can check in the original system which method was used.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Can I get a native dump (Dr. Watson) when JNI code causes an exception?

    Is there a way to get the JVM to just not trap an exception, so that we can get a native dump? I have tried -XX:OnError="drwtsn32 -p %p". This did produce a Dr. Watson dump, but not a good one. I placed a deliberate error in the code, and called it outside of java, and got a good log file (with the fault in my DLL), but the same module called via JNI gave me a bad log file, with the fault point in ntdll.dll.
    This is happening in java 1.4.2. In the field, the jvm is provided by IBM Websphere 6 on Windows 2000. I'm unable to duplicate the error, but am running the above mentioned tests in my Eclipse 3.1 + Weblogic 8.1development environment on Win XP.

    Queer!
    This is not an error message I see when I try to execute a program not in my path!
    And when I do not specify libraries to be linked, I get a linking error!
    This seems to be a preprocessor error.
    What could it possibly be?
    Do you have the correct calling convention in the case of #ifdef __cplusplus ??
    I guess that should have been already done by your javah.
    I wonder.
    I also wonder if cl.exe actually stands for "command line" exe
    Can you pls send me all the files at [email protected] ??
    cheers

Maybe you are looking for

  • No sound from playing avi files in front row.!!!!!!!!!!!!!!!!!!!!!!!!!

    I can play my avi files from front row when I put them into the movies folder...however, the music just won't play!!!~~~~~~ is anyone else having this problem? anyone with a solution? please please help!!!!

  • What is Continuous Data Protection (CDP) & how does it work?

    When it comes to Backup and Disaster Recovery (BDR), it's important to know how it functions and which service best fits your clients' needs. Is Continuous Data Protection more cost effective than legacy backup products? How does CDP actually work? W

  • HT201269 How can I open a movie in iTunes

    My movie is avi format and I want to be able to play in Itune. What I can do? Very new to Apple.

  • MacBook or MacBook Pro I cannot decide?

    I've a Lenovo 15.4" 3000 N200 laptop currently running vista and a screen resolution of 1680x1050. After much thought and temptation from others running macs I'm looking at changing to a mac. The 2 I am looking at are the MacBook 2.4GHz, with a 320Gb

  • Rimregistry wont run

    Newbie-ish question, I cant get rmiregistry to run for some reason. What exactly do I have to do to run it? and rmic wont work either when i use it to compile.