My environment is C/C++ under VS.NET 2003 edition.
I port games amongst cell phone handsets; part of the testing is building a DLL that runs on a PC-based emulator. Each game has several source files. I also have a file from the SDK I need to include with each build. I have two SDK versions. So I need either c:/vendor/version_1/src/foo.c or c:/vendor/version_2/src/foo.c. Foo.c never changes, so I want to build it out of the vendor's SDK distribution.
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
I also need to include header files from either c:/vendor/version_1/inc, or c:/vendor/version_2/inc.
Right now I have one solution per game, with several configurations to deal with the handsets. It works very well except for that pesky foo.c file.
Ideally, I'd like to have a single variable, $(VERSION) or some such, and key the SRC and INC directories off this. If that isn't possible, can I somehow have multiple source file listed in a single solution?
If all else fails, I can use a pre-build rule to copy the foo.c file to the local directory, and a post build rule to delete the silly thing. This seems, well, silly.
Here's an idea: why not create a file in your project called MYFOO.C that only consists of a single line that looks like this:
#include <foo.c>Then, each configuration has a different include directory for foo.c based on the version (which you already do for the header files).
Dig Deeper on Win Development Resources
Related Q&A from Berni McCoy
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.