Hi everyone,

I am creating a simple shared library which contains the following files:
mylib.h and mylib.cpp

the code for mylib.pro is:
Qt Code:
  1. QT -= gui
  2.  
  3. TARGET = myLIB
  4. TEMPLATE = lib
  5. SOURCES += mylib.cpp
  6.  
  7. HEADERS += mylib.h
To copy to clipboard, switch view to plain text mode 


the code for mylib.h is:
Qt Code:
  1. #ifndef MYLIB_H
  2. #define MYLIB_H
  3.  
  4. extern "C"{
  5. __declspec(dllexport) int __stdcall hello();
  6. }
  7.  
  8. #endif // MYLIB_H
To copy to clipboard, switch view to plain text mode 


the code for mylib.cpp is:
Qt Code:
  1. #include "mylib.h"
  2.  
  3. __declspec(dllexport) int __stdcall hello()
  4. {
  5. return 56; [QUOTE]hello() is a simple function which returns 56[/QUOTE]
  6. }
To copy to clipboard, switch view to plain text mode 


After building the project, i am getting a myLIB.dll file in debug directory. I am able to use this DLL in a visual C# project by referencing to the DLL in C# code.
But i am not able to use the hello() function of the DLL in java.


So, can anyone please tell me the correct way of creating a DLL in Qt, which i can further use in Java?


Thanks in advance,

With regards,
Satya Prakash.