English 中文(简体)
Creating 64 bit CLR C++ projects in VS2008
原标题:

I am creating a wrapper around a native lib, which comes in both 32 & 64 bit flavors. I have a fairly complex C++/CLR project that includes a number of header files from the native libs. I got it to work fine on x32, but now I m not sure how to provide an alternative x64 build.

Can someone outline the steps to create such project?

  • Various defines depend on _WIN32 / _WIN64, so must be multiple projects?
  • Both x32/x64 native libs have identical file names. Currently the lib ref is done with #pragma comment (lib, "xxxxxx.lib"). How should this be changed?

Lastly - VS2008 has only Win32 platform listed, not Win64 (I do have x64 VS2008 component installed).

Thanks!

最佳回答

Normally it is sufficient to select the drop down which says win32 (next to the Debug/Release one on the toolbar) and selected "Configuration Manager". Then open the "Active Solution Platform" drop down and select New. Choose x64 type (which if it doesn t exist then 64bit compilers are not installed) and copy solution from the orignal Win32 one. Now your project can be built selectively by changing the drop down on the toolbar.

Normally it works more or less as is but you might want to consider tweaking a few pre-processor defines if only for the intellisense.

As for libraries, for platform ones (supplied as part of VS/PSDK) then you dont need to change anything. For your libraries you are wrapping then change the Additional Library Directories in the project properties to point to the 64bit directory.

问题回答

Visual studio doesn t always install the 64 bit options.

It can be fixed by running the VS installer, choosing add/remove features, and checking the x64 feature.





相关问题
System Architecture

How do I determine whether the currently running Mac OS X system is of 32bit or 64bit machine?

Starting Assembly

I m new to assembly language, and would like to learn. I have Vista-64 (will be upgraded to Windows 7 64), and I will soon be reinstalling 32-bit Linux, but I will end up programming on both systems, ...

Does a 64-bit CruiseControl.NET exist?

Does a 64-bit CruiseControl.NET exist or do I need to install the 32-bit version? Our CI server is Server2003 64-bit. Currently I have been testing on WinXP Pro and no problems. If I do need to run ...

32bit application access to 64bit registry

I have an OS Shell written in 32bit that is replacing the Explorer.exe of a Vista machine. I run a utility which is also written in 32bit, which allows to switch between the Explorer shell and My ...

热门标签