Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:20:51+00:00 2026-06-03T19:20:51+00:00

i am working on some java application in which i am using jni. Well

  • 0

i am working on some java application in which i am using jni. Well here now i want to call pure c++ function from JNI method. well i am doing this as shown as below code. here dll is created but when i am trying run i get the error java.lang.UnsatisfiedLinkError: Can’t find dependent libraries. i am creating my dll in visual studio. so tell me what i am doing wrong in calling c++ function.

here is code of my .cpp file

#include "SensorDetect.h"
#include <stdio.h>
#include <windows.h>
// Include specific Tools header
#include "Tools.h"
   // Include IO_XRayUSB_MD_VC80 header
#include "IO_XRayUSB.h"

// Include IO_XRayUSB_MD_VC80 library
#pragma message ("Using : IO_XRayUSB_MD_VC80.lib")
#pragma comment(lib, "IO_XRayUSB_MD_VC80.lib")

//// Custom user Callback function which is called by IO_XrayUsb when a device is plugged or unplugged
void _stdcall DevicePlugUnplugCallback(XRay_CALLBACK * pCallBackInfo, int nCallBackCount)
{
    if (pCallBackInfo && (nCallBackCount > 0))
    {
        for (int nDeviceIndex = 0; nDeviceIndex < nCallBackCount; nDeviceIndex ++)
        {
            switch(pCallBackInfo[nDeviceIndex].nState)
            {
                case XRAY_USB_PLUGGED_DEVICE :
                    printf("\n=>Callback Device: %s has been Plugged...\n\n", pCallBackInfo[nDeviceIndex].pcDeviceName);
                    break;
                case XRAY_USB_UNPLUGGED_DEVICE :
                    printf("\n=>Callback Device: %s has been Unplugged...\n\n", pCallBackInfo[nDeviceIndex].pcDeviceName);
                    break;
                default:
                    break;
            }
        }
    }
}


extern "C"
JNIEXPORT void JNICALL Java_sensordetect_SensorDetect_getDevice(JNIEnv * env, jclass cl)
{

     const int nNbMaxDevices = 10;
    char pDeviceList[nNbMaxDevices][260];
    int nDeviceCount = 10;
    XRay_HANDLE hDevice;
    XRay_SENSOR_INFO SensorInfo;


    //int nTriggerMode = GetChoice(1, "Choose Trigger Mode:\t0:XVIS_detection    1:TWI_request_detection");
    char pcBuffer[100];
    int nKey;

        nKey=0;

            int nTriggerMode=nKey;

    try
    {
        // XRay_RegisterCallBackPlugDevice to be notified of device plug/unplug
**//This function call creates problem in loading dll. error:Can't find dependent libraries**
     BOOL bSuccess = XRay_RegisterCallBackPlugDevice(DevicePlugUnplugCallback);    


        //for (int nIndex = 0; nIndex < 1; nIndex ++)
            printf("\tFound device : %s\n", pDeviceList[0]);

    }
    catch (...) // catch own CMyException
        {
            //e.ShowReason();
        }

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:20:53+00:00Added an answer on June 3, 2026 at 7:20 pm

    Either IO_XRayUSB_MD_VC80.dll or one of is dependents is not in one of the directories listed in the PATH environment variable, or does not exist in the same directory where your application is running.

    To get a list of DLLs on which a DLL depends you can use dumpbin.exe:

    dumpbin.exe /DEPENDENTS C:\path\to\IO_XRayUSB_MD_VC80.dll

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an application which retrieves some HTML code from a record in
I was working on a project which includes developing an application using java sockets.
I'm working on a client-side Java application for which I want to create a
I am working on a Java application which has a threading issue. While using
I am working in Java EE application which supports authentication and managing some simple
I am working on an application which has some forms and then using FOP
I am working on some code using the EMF framework in Java, but it
I'm using net beans for Java development. I'm working on a multi threading application
Scenario: I have been using Java SE for quite some time, working with threads
i want to protect my Java product by using some USB-based authentication and password

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.