Ok, I've grabbed a copy of VS2008 Express (it was only 90mb) and done some investigation.
DragonM wrote:
David Williams wrote:
DragonM wrote:
Bizarrely, #including RawVolume.h and NOT including either ForwardDeclarations or LargeVolume.h, I get the LargeVolume Sampler errors reported in my first post (using my reported modification). No mention of RawVolume. Without my modification, I get an internal compiler error.
That sounds a little strange - I will try to find some time to test this for myself. I don't currently have VS2008 installed but can probably download the express version. However, I'm on a 5Gb/month download limit so I have to be a little careful. I think I can spare it though and it would be good to test.
I got more than one instance of peculiar behavior in that respect, including a successful build of LargeVolume<Material8> while Material.h wasn't included. It's apparently very easy to confuse VS2008 when dealing with complex templates.
This behaviour is (at least mostly) occuring because the #includes are a mess in the code. LargeVolume.h is included in a lot of places it shouldn't be. Actually I remember noticing this a few weeks ago when doing the volume refactoring, so I'll be sure to get it tidied up.
DragonM wrote:
The library itself builds fine, but LargeVolume can't be instantiated. In fact, LargeVolume.h can't even be included. The attempt causes an internal compiler error.
I managed to reproduce this quite easily, and it was fixed by removing some inheritance as previsouly suggested. However, I then noticed something interesting - when I checked out a fresh version of PolyVox and used CMake to generate the solution files it all compiled and ran perfectly, including the examples. However, the external test project was still giving an internal compiler error.
Eventually I started comparing compiler options and identified the '/Gm' switch as being the problem. This corresponds to '
Enabled Minimal Rebuild' and is on by default in a VS generated project but off in a CMake generated project. Removing this flag from the test project does seem to allow it to build correctly.
There is some chance that this issue is a result of the header file mess mentioned above. From the MSDN page:
MSDN wrote:
Minimal rebuild relies on class definitions not changing between include files. Class definitions must be global for a project (there should be only one definition of a given class), because the dependency information in the .idb file is created for the entire project. If you have more than one definition for a class in your project, disable minimal rebuild.
At any rate I think I should first sort out the header dependancies and then see whether this '/Gm' switch is still a problem.