Reputation: 301
In a project I'm working on, I have two preprocessor definitions (CPU_RENDER and GPU_RENDER) that control whether the build uses the CPU to render a scene or the GPU. I've been flipping back and forth between these two as I develop the software.
Suddenly, however, a few of the files claim GPU_RENDER is defined despite the fact that I removed it from Visual Studio's preprocessor definitions. Others work correctly. This isn't just visual, as the CPU build fails on link now, trying to find the source code for certain GPU only functions.
I've performed a search of the entire solution for "#define GPU_RENDER", just in case I did something stupid, but that came up empty. I then searched for every time I reference GPU_RENDER, but all those were just ifdefs.
I haven't used any new libraries so I don't think this could be a name collision.
Upvotes: 0
Views: 350
Reputation: 301
Apparently the offending files had acquired their own set of preprocessor definitions. (I must have hit "Properties" with a file selected instead of the project at some point, making the file have a local set of definitions)
Deleting the file's personal definitions and ticking the "inherit from parent or project defaults" box solves the problem.
Upvotes: 2