Home › Forums › TWAIN Classic › program not compiling
- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- Diego Guimaraes
Hi I’m trying to develop a simple Java App that calls twain
My c program is this but it is not compiling. I’m getting a bunch of errors like this “HANDLE does not name a type”, “LPVOID does not name a type”
#include <jni.h> #include <stdio.h> #include "twain.h" #include "HelloWorld.h" JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject obj) { printf("Hello World from C function!\n"); } JNIEXPORT void JNICALL Java_HelloWorld_scan(JNIEnv *env, jobject obj) { printf("Scanning") }
My HelloWorld.h is
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class HelloWorld */ #ifndef _Included_HelloWorld #define _Included_HelloWorld #ifdef __cplusplus extern "C" { #endif /* * Class: HelloWorld * Method: print * Signature: ()V */ JNIEXPORT void JNICALL Java_HelloWorld_print (JNIEnv *, jobject); /* * Class: HelloWorld * Method: scan * Signature: ()V */ JNIEXPORT void JNICALL Java_HelloWorld_scan (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif
I got the twain.h from this link https://www.codeproject.com/KB/audio-video/twaintest/twaintest_src.zip
I’m trying to generate a dll using this command from MinGW64
g++ -shared -I “C:\Program Files\Java\jdk1.8.0_101\include” -I “C:\Program Files\Java\jdk1.8.0_101\include\win32” HelloWorld.c -o HelloWorld.dll
MarkMThe twain.h file is for C/C++ only. There are Java libraries that interface to TWAIN. Searching for “java twain library” finds several…
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)