overview
The same dll(tableOcr.dll) in different system win10s(win10 family series and win10 professional series ) behave different result.
build tool
1. java
2. corretto-1.8.0_302
openjdk version "1.8.0_302"
OpenJDK Runtime Environment Corretto-8.302.08.1 (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM Corretto-8.302.08.1 (build 25.302-b08, mixed mode)
3. c++11
4. visual studio 2017 (14.9)
background
I need java(x64) call my c++ func through jni, my shared library is tableOcr.dll(x64) and tableOcrJni.dll(x64) which links to tableOcr.dll; I did those steps:
- build my tableOcr.dll(x64) with visual studio 2017 (14.9), windows SDk version 10.0.17763.0 in win10 professional(x64 version=10.0.18363.1440) . TableOcrJNI.dll denpentent is tableOcr.dll,lickey_parse.dll and opencv_world430.dll(checked by x64 depend.exe) One of tableOcrJNI.dll function is :
#ifndef OCREXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define OCR_EXPORT
# else
# define OCR_EXPORT __declspec(dllexport) ///! 为了动态加载动态库
//# define OCR_EXPORT ///! 为了动态加载动态库
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define OCR_EXPORT __attribute__ ((visibility("default")))
# else
# define OCR_EXPORT
# endif
# endif
#endif
OCR_EXPORT int _cdecl obtain_table_info_init(const char* _IN_ models
Use a test.exe(build on x64 professional win10) test win32 loadLibrary way to load tableOcrJni.dll. this dll loaded with absolute path.
It success.
Use java test program load my tableOcrJni.dll, it result in is not valid win32 IN windows 10 family series (x64 version=10.19043.1706)
addition
:
- I'm pretty sure %PATH% is OK for my java, I add my dlls(all linked dlls) path
E:/mydll/
in It. - I tried some solution found in google(included this palce), not helped.
- I tried step 3 in win10 professional(x64 version=10.0.18363.1440) series(), it is OK.
- I tried install vs 2017 on win10 family serial,and do step all failed.
- I tried build x64 corretto-1.8.0_302 jdk on x64 win10 family and do step3, failed.