none
64 bit Compiler RRS feed

  • Question

  • What is diffrence between WIN64 and _WIN64 Preprocessors?

    Which Preprocessor I have to use for compile 64 bit application?

    I have used WIN64 but it is not working for some header files such as sqlucode.h

    the function

    SQLColAttributeW disabled for 64 bit.

    How to fix this problem?

    Wednesday, August 24, 2011 1:44 PM

Answers

  • Hello,

     

    As far as I know, WIN64 and _WIN64 are the preprocessor Definitions in your project settings. You can change or add another word for #f or #ifdef in your application.

     

    However, I just found that ODBC use #ifdef _WIN64 in it's head files, and the SQLColAttribute function declaration is changed. Therefore, I suggest you to add  _WIN64 in preprocessor definitions and check the SQLColAttribute function parameters in 64-bit.

     

    I hope my suggestions can help you to solve this problem.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 29, 2011 6:14 AM
    Moderator
  • _WIN64 is predefined macro automatically defined when building 64 bit target. You do not need to define it manually. I'm unsure what WIN64 is for.
    Yan
    Wednesday, August 24, 2011 6:14 PM
  • Yan was on the right track.  _WIN64 is one of the Predefined Macros which get set when you compile for a 64-bit target; if you want to build a 64-bit application first make sure that your are building for the x64 platform in Visual Studio. 

    This should ensure that the correct definition of SQLColAttributeW is available.  You don't say which version of Visual Studio and Windows SDK you are working with, and it's possible that older versions of these might be different with regard to SQLColAttributeW.

    DO NOT simply try to define  _WIN64 on a 32-bit target.

    _WIN64 (with the underscore) is the macro used by the Microsoft SDK include files for this purpose - never WIN64 (without the underscore).  Note that it is perfectly valid for both _WIN32 and _WIN64 to be defined at the same time (it means that the Win32 API is being used in a 64-bit build).  Some third-party API vendors might choose to use WIN64 to distinguish two versions of their API, I suppose.


    Answering policy: see profile.
    Monday, August 29, 2011 12:11 PM

All replies

  • _WIN64 is predefined macro automatically defined when building 64 bit target. You do not need to define it manually. I'm unsure what WIN64 is for.
    Yan
    Wednesday, August 24, 2011 6:14 PM
  • Hello,

     

    As far as I know, WIN64 and _WIN64 are the preprocessor Definitions in your project settings. You can change or add another word for #f or #ifdef in your application.

     

    However, I just found that ODBC use #ifdef _WIN64 in it's head files, and the SQLColAttribute function declaration is changed. Therefore, I suggest you to add  _WIN64 in preprocessor definitions and check the SQLColAttribute function parameters in 64-bit.

     

    I hope my suggestions can help you to solve this problem.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 29, 2011 6:14 AM
    Moderator
  • Yan was on the right track.  _WIN64 is one of the Predefined Macros which get set when you compile for a 64-bit target; if you want to build a 64-bit application first make sure that your are building for the x64 platform in Visual Studio. 

    This should ensure that the correct definition of SQLColAttributeW is available.  You don't say which version of Visual Studio and Windows SDK you are working with, and it's possible that older versions of these might be different with regard to SQLColAttributeW.

    DO NOT simply try to define  _WIN64 on a 32-bit target.

    _WIN64 (with the underscore) is the macro used by the Microsoft SDK include files for this purpose - never WIN64 (without the underscore).  Note that it is perfectly valid for both _WIN32 and _WIN64 to be defined at the same time (it means that the Win32 API is being used in a 64-bit build).  Some third-party API vendors might choose to use WIN64 to distinguish two versions of their API, I suppose.


    Answering policy: see profile.
    Monday, August 29, 2011 12:11 PM
  • Also, Intellisense doesn't recognize _WIN64 even though the compiler does.  Keep that in mind.
    Monday, August 29, 2011 1:11 PM
  • Hello,

     

    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, September 2, 2011 6:46 AM
    Moderator