Three-part question first:
Note that I'm referring to the build-time macros such as $(ProjectDir)
, not the IDE macros used to record a series of keystrokes -- they took those away, but I can live without them. I have been defining my own build-time macros via the property pages in Visual Studio 10. For example, I might create a macro to define where Boost is installed on my local computer named $(BoostDir)
in x64 builds via View>Property Manager>Microsoft.Cpp.x64.user:
I use this functionality because I might have (for example) Boost installed in different locations on different computers. These properties are machine-specific, and not checked in to source control. I can then use these macros in the project settings which are checked in to source control, and it should work on every machine I compile this project on so long as I have defined the macros for that machine.
In trying to compile & run my VS10 projects in the Visual Studio 11 Developer Preview, I'm running in to a couple of issues with respect to these macros.
First, in VS11 there does not appear to be an interface to define these user-defined macros. Where they were in VS10, there is now just nothing in VS11:
It appears that these macros do exist at some level within the Compiler/IDE, because I am able to compile my project without errors, which I wouldn't be able to do if these macros didn't exist somewhere.
Second, while the macros seem to exist during the build process, they don't appear to exist during the Debugging session. Macros I used to resolve the directories where certain DLLs exist in VS10 now don't resolve those directories in VS11, and I get run-time errors:
The directory where this DLL is located is defined here in VS10 and VS11:
...but my macros don't seem to mean anything during the debug session.
How can I get all the macro-related functionality I depended upon in VS10 back in VS11?
If you haven't already figured out how to do this, you need to use your own property sheets.
Make a new property sheet, and use the section in Common Properties > User Macros.
For example, I have a macro called BOOST_VER in a property sheet called IncludeBoost.props that I set everything in.
User Macros
Name Value
BOOST_VER 1.49.0
C/C++ > General > Additional Include Directories >
"$(environment variable)\3rdParty\Boost_$(BOOST_VER)\Boost";%(AdditionalIncludeDirectories)
C/C++ > Preprocessor > Preprocessor Definitions >
BOOST_ALL_DYN_LINK;%(PreprocessorDefinitions)
Linker > General
$(env var)\3rdParty\Boost_$(BOOST_VER)\Boost\lib\$(Platform);%(AdditionalLibraryDirectories)
Note that the proper platform is picked too (Win32 or x64).
BTW, the Property Manager supports Ctrl+click multiple selection.
HTH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With