TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

program not compiling

Forums › TWAIN Classic › program not compiling

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 30, 2017 at 7:01 am #29952 Reply
    Diego Guimaraes
    • Topics - 94
    • Replies - 183
    • Total Posts - 277

    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

    May 4, 2017 at 6:36 am #29979 Reply
    MarkM
    • Topics - 94
    • Replies - 183
    • Total Posts - 277

    The twain.h file is for C/C++ only. There are Java libraries that interface to TWAIN. Searching for “java twain library” finds several…

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: program not compiling
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

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.