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 7914101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:00:07+00:00 2026-06-03T14:00:07+00:00

I am trying to generate a dll which I can access from java via

  • 0

I am trying to generate a dll which I can access from java via JNA.

I just try a simple one:

CPP:

void Initialize()
{
  std::cout<< "Hello World!";
}

iostream is also included and after compiling I get: CreateDll.dll

Via Visual Studio I can generate now a *.dll.

which I try loading into Java like:

public class mainRoutine {
  public static void main(String[] args) {
    NativeWrapper INSTANCE = (NativeWrapper) Native.loadLibrary("CreateDll" , NativeWrapper.class);             
    INSTANCE.Initialize();
  }

  static {
    System.setProperty("jna.library.path", "C:\\workspace\\JNA");
  }
}

There is also another Interface:

import com.sun.jna.Library;

public interface NativeWrapper extends Library {
  void Initialize();
}

So but now running the Java function I get the error,

 java.lang.UnsatisfiedLinkError: 
  Error looking up function 'Initialize': 
   The specified procedure could not be found.

What am I missing?

PS: I know there are many topics, but trying for a day already I have not found the solution. Please help me.

  • 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-03T14:00:15+00:00Added an answer on June 3, 2026 at 2:00 pm

    You need to both export and (if using C++) un-decorate the function name.

    On windows, functions are typically made available for export with __declspec(dllexport).

    On any platform, to ensure a function is exported in unmanagled form, you must use extern "C".

    Specifically:

    extern "C" void __declspec(dllexport) Initialize() { ... }
    

    There are other ways to designate exported functions, but this is probably the most common and straightforward to use. If you don’t use extern "C", your function will look something like InitializeZ@ASDF@, where the additional garbage characters are used by the compiler and linker to make a given function uniquely recognizable based on its calling signature.

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

Sidebar

Related Questions

While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
I am trying to use a .NET DLL from Java code ( Through a
I'm trying to deploy a java web app which uses FreeTTS to generate mp3s.
I trying to generate an XML document which is around 23 to 30 MB,
I am trying to generate a heatmap in R for a dataset, which has
I'm trying to generate customized xml files from a template xml file in python.
I have a very simple table in access. The data is stored from VB.NET
I’m having some difficulties while trying to consume an unmanaged-code dll from my application
I've been trying to generate a satellite assembly using the LocBaml tool downloaded from
I have a WCF service which I am trying to use to generate an

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.