[Bf-committers] Compiler error with MSVC6 on SG_Tree.cpp
Douglas Toltzman
bf-committers@blender.org
Mon, 17 May 2004 16:45:48 -0400 (EDT)
For these errors, you'll need to declare x and y one time and remove the
declarations in the for (...;...;...) constructs.
e.g.
Add a line at 271 that reads; "unsigned int x;"
Then inside the "for ( unsigned int x ..." remove the "unsigned int".
Repeat the "unsigned int" removal for the next "for ( unsigned int x..."
line a little further down. What you are seeing is a scoping error.
I'm not sure where "y" is, but it's probably the same problem.
On Mon, 17 May 2004, Peter den Bak wrote:
> Thanks Douglas,
>
> It works, but this only leaves 2 errors.
>
> Compiling...
> SG_Tree.cpp
> F:\Develop\CVStree\blender\source\gameengine\SceneGraph\SG_Tree.cpp(283) :
> error C2374: 'x' : redefinition; multiple initialization
>
> F:\Develop\CVStree\blender\source\gameengine\SceneGraph\SG_Tree.cpp(272) :
> see declaration of 'x'
> F:\Develop\CVStree\blender\source\gameengine\SceneGraph\SG_Tree.cpp(288) :
> error C2374: 'y' : redefinition; multiple initialization
>
> F:\Develop\CVStree\blender\source\gameengine\SceneGraph\SG_Tree.cpp(246) :
> see declaration of 'y'
> Error executing cl.exe.
>
> blender.exe - 2 error(s), 0 warning(s)
>
> Here is the code, line 269-295:
>
> /* Remove other bboxes that contain the two bboxes */
> sizes.delete_column(miny);
>
> for( unsigned int x = miny + 1; x < num_objects; x++)
> {
> if (x == minx)
> continue;
> delete sizes(x, miny);
> }
> sizes.erase_row(miny);
>
> num_objects--;
> minx--;
> sizes(minx, minx) = min;
> for( unsigned int x = minx + 1; x < num_objects; x++)
> {
> delete sizes(x, minx);
> sizes(x, minx) = new SG_Tree(min, sizes(x, x));
> }
> for( unsigned int y = 0; y < minx; y++)
> {
> delete sizes(minx, y);
> sizes(minx, y) = new SG_Tree(sizes(y, y), min);
> }
> }
> return sizes(1, 0);
> }
>
> I think I know how to solve this one :-) but perhaps its better the author
> of SG_Tree.cpp does a new commit with some fixes, making the CVStree MSVC6
> compliant again.
>
> Regards,
>
> Peter