How to setup the project settings when create an x64 project in cs2008?
-
By the artical: http://msdn.microsoft.com/en-us/library/9yb4317s(v=vs.80).aspx[^] After create a new platform of x64, I can create a new solution configuration for Debug Win64 and copy settings from Debug Win32. But I wonder how to set the properties for the x64 solution. After I create new solution configuration and copy settting from Win32, I found the macro WIN32 is still there, but not replaced by WIN64. For win64 application, which macro(s) should I set in the /D setting? Should I keep the /DWIN32? Btw, I found the _WIN32,_WIN64 macro in MFC source code, but not WIN32,WIN64. Which one is required in the /D setting? Thanks for your inputs. /Sam
-
By the artical: http://msdn.microsoft.com/en-us/library/9yb4317s(v=vs.80).aspx[^] After create a new platform of x64, I can create a new solution configuration for Debug Win64 and copy settings from Debug Win32. But I wonder how to set the properties for the x64 solution. After I create new solution configuration and copy settting from Win32, I found the macro WIN32 is still there, but not replaced by WIN64. For win64 application, which macro(s) should I set in the /D setting? Should I keep the /DWIN32? Btw, I found the _WIN32,_WIN64 macro in MFC source code, but not WIN32,WIN64. Which one is required in the /D setting? Thanks for your inputs. /Sam
I think you have't fully understood that article. When you are copying win32 settings to x64, that article clearly mentioned to change win32 switch to win64 for /D switch
Quote:
Values of WIN32 are replaced by WIN64 for /D (Preprocessor Definitions).
Quote:
I found the _WIN32,_WIN64 macro in MFC source code
Which source code? your code or in any of the standard headers? If it is yours, then you should take care to propely to map these settings to win32 and win64 pre-processor definitions
-
I think you have't fully understood that article. When you are copying win32 settings to x64, that article clearly mentioned to change win32 switch to win64 for /D switch
Quote:
Values of WIN32 are replaced by WIN64 for /D (Preprocessor Definitions).
Quote:
I found the _WIN32,_WIN64 macro in MFC source code
Which source code? your code or in any of the standard headers? If it is yours, then you should take care to propely to map these settings to win32 and win64 pre-processor definitions
Some marcos like WIN32/_WIN32 and WIN64/_WIN64 are used by VC++. I am not sure what's the difference between WIN32/WIN64 and _WIN32/_WIN64.
Lakamraju Raghuram wrote:
I think you have't fully understood that article.
When you are copying win32 settings to x64, that article clearly mentioned to change win32 switch to win64 for /D switchRefering to the artical, the WIN32 macro should be repalced by WIN64 with /D switch support. But after I did it under the steps, the WIN32 macro still there but not replaced by WIN64. You may try it from your side. So I am confused by the result.I wonder if it is a defect of vs2008 IDE. Some other articals mentioned that the WIN32 macro always should be set with /D switch and with WIN64 macro definied for x64 application perspectively.
Lakamraju Raghuram wrote:
Which source code? your code or in any of the standard headers?
If it is yours, then you should take care to propely to map these settings to win32 and win64 pre-processor definitionsI found the _WIN64 macro in MFC header file of basestd.h. Here a code snap:
#if defined(_WIN64)
typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;typedef \_\_int64 LONG\_PTR, \*PLONG\_PTR; typedef unsigned \_\_int64 ULONG\_PTR, \*PULONG\_PTR; #define \_\_int3264 \_\_int64
#else
typedef _W64 int INT_PTR, *PINT_PTR;
typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;typedef \_W64 long LONG\_PTR, \*PLONG\_PTR; typedef \_W64 unsigned long ULONG\_PTR, \*PULONG\_PTR; #define \_\_int3264 \_\_int32
#endif
So I am not sure which macro I should set in the preprocessor definition setting. By default, VS2008 IDE set the WIN32 macro with /D switch. Also I found _WIN32 macro is used in the MFC header files and source files.
-
Some marcos like WIN32/_WIN32 and WIN64/_WIN64 are used by VC++. I am not sure what's the difference between WIN32/WIN64 and _WIN32/_WIN64.
Lakamraju Raghuram wrote:
I think you have't fully understood that article.
When you are copying win32 settings to x64, that article clearly mentioned to change win32 switch to win64 for /D switchRefering to the artical, the WIN32 macro should be repalced by WIN64 with /D switch support. But after I did it under the steps, the WIN32 macro still there but not replaced by WIN64. You may try it from your side. So I am confused by the result.I wonder if it is a defect of vs2008 IDE. Some other articals mentioned that the WIN32 macro always should be set with /D switch and with WIN64 macro definied for x64 application perspectively.
Lakamraju Raghuram wrote:
Which source code? your code or in any of the standard headers?
If it is yours, then you should take care to propely to map these settings to win32 and win64 pre-processor definitionsI found the _WIN64 macro in MFC header file of basestd.h. Here a code snap:
#if defined(_WIN64)
typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;typedef \_\_int64 LONG\_PTR, \*PLONG\_PTR; typedef unsigned \_\_int64 ULONG\_PTR, \*PULONG\_PTR; #define \_\_int3264 \_\_int64
#else
typedef _W64 int INT_PTR, *PINT_PTR;
typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;typedef \_W64 long LONG\_PTR, \*PLONG\_PTR; typedef \_W64 unsigned long ULONG\_PTR, \*PULONG\_PTR; #define \_\_int3264 \_\_int32
#endif
So I am not sure which macro I should set in the preprocessor definition setting. By default, VS2008 IDE set the WIN32 macro with /D switch. Also I found _WIN32 macro is used in the MFC header files and source files.
SAMZCN wrote:
So I am not sure which macro I should set in the preprocessor definition setting.
My 64 bit projects have
_WIN64
defined in the preprocessor definitions. Btw... you are correct... when you copied the project settings it should have been automatically updated by Visual Studio. Best Wishes, -David Delaune