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

Noob Question – How to compile TWAIN?

Forums › TWAIN Classic › Noob Question – How to compile TWAIN?

  • This topic has 5 replies, 3 voices, and was last updated 10 years, 8 months ago by twainuser123.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • March 5, 2010 at 12:14 am #22586 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    Hi,

    I am a relatively new programmer (3 years) and am trying to use TWAIN.

    However, when I try to compile this code in MSVC++2008:

    #include "twain.h"

    int main()
    {
    return 0;
    }

    I get 174 errors like

    error C2146: syntax error : missing ';' before identifier 'TW_HANDLE'

    How do I make it work?

    Thanks in advance!

    March 5, 2010 at 11:28 am #25188 Reply
    Kaij
    Participant
    • Topics - 9
    • Replies - 132
    • Total Posts - 141


    #include "twain.h"

    int main()
    {
    return 0;
    }

    You are missing declarations required in twain.h.


    #include
    #include "twain.h"

    int main()
    {
    return 0;
    }

    solves that.

    Best regards,

    Kaij

    March 6, 2010 at 5:12 am #25189 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    It compiled!
    Thanks for your help!

    But, I have two more questions:
    1. Is twain.h dependent on any other files or libraries besides windows.h?
    2. How would I be able to compile twain.h for Linux Ubuntu?

    Thanks in advance!

    May 22, 2010 at 5:21 am #25190 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    I found at least one of the answers through time…

    1. Yes, twain_32.dll for TWAIN 1.X and twainDSM.dll for TWAIN 2.X applications. You need to load the DSM_Entry() function to work with TWAIN.

    No need to respond. Just noting this here for future forum searches.

    May 31, 2010 at 1:34 pm #25191 Reply
    MSM
    Participant
    • Topics - 0
    • Replies - 29
    • Total Posts - 29

    Check command prompt sample application from TWAIN Working Group:
    http://sourceforge.net/projects/twain-samples/files/

    June 5, 2010 at 3:27 am #25192 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    Thanks, but I got it working now.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Reply #25189 in Noob Question – How to compile TWAIN?
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

  • Scanner starts transfer when console gets closed (CITRIX)
  • Kodak RFS 3600
  • Didn’t save enough file scan
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • 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.