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

twain.h with C++Builder

Forums › TWAIN Classic › twain.h with C++Builder

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 9 months ago by twainuser123.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 15, 2010 at 6:47 pm #22619 Reply
    efrenba
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Hi there,

    When I try to compile a project under C++ Builder6 with twain.h the compiler shows me the error:

    [C++ Fatal Error] twain.h(130): F1003 Error directive: Unrecognized compiler

    I read in the C++Builder’s help that __BORLANDC__ is a global identifier, not __BORLAND__.
    I tried changing the identifier __BORLAND__ for __BORLANDC__ but the errors increased:

    [C++ Error] twain.h(1863): E2257 , expected
    [C++ Error] twain.h(1864): E2238 Multiple declaration for ‘huge’
    [C++ Error] twain.h(1863): E2344 Earlier declaration of ‘huge’
    [C++ Error] twain.h(1864): E2257 , expected
    [C++ Error] twain.h(2066): E2238 Multiple declaration for ‘TW_UINT16’
    [C++ Error] twain.h(209): E2344 Earlier declaration of ‘TW_UINT16’
    [C++ Error] twain.h(2066): E2356 Type mismatch in redeclaration of ‘TW_UINT16’
    [C++ Error] twain.h(209): E2344 Earlier declaration of ‘TW_UINT16’
    [C++ Error] twain.h(2066): E2141 Declaration syntax error
    [C++ Error] twain.h(2139): E2238 Multiple declaration for ‘TW_UINT16’
    [C++ Error] twain.h(2066): E2344 Earlier declaration of ‘TW_UINT16’
    [C++ Error] twain.h(2139): E2141 Declaration syntax error
    [C++ Error] twain.h(2178): E2075 Incorrect pragma directive option: ÿ–a.
    [C++ Warning] twain.h(2191): W8059 Structure packing size has changed
    [C++ Warning] _prolog.h(47): W8059 Structure packing size has changed
    [C++ Warning] _prolog.h(19): W8059 Structure packing size has changed
    [C++ Warning] _epilog.h(32): W8059 Structure packing size has changed
    [C++ Warning] _epilog.h(38 ): W8059 Structure packing size has changed

    I downloaded the twain19.h and with it I could compile the project.

    Is there a solution that allows me to use twain.h with C++Builder6?

    thanks in advance,
    Efren

    July 16, 2010 at 3:06 am #25290 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    I don’t know if you tried this, but type this BEFORE including twain.h:

    #undef __BORLANDC__
    #define __BORLAND__

    Otherwise, modify this line in twain.h

    #else
    #error Unrecognized compiler

    to

    #else
    #define TWH_CMP_BORLAND
    #define TWH_32BIT

    Note this breaks the compiler portability of twain.h

    Hope that helps.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: twain.h with C++Builder
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

  • TWAIN for dental imaging integration
  • PDF/R For who and where?
  • Making searchable PDF with PDF/R
  • Backward compatibility with PDF/A and traditional PDF
  • could not open the twain source. Make sure there is a valid source for your sca
  • 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.