Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Visual Studio 2010 Warnings
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=165
Page 1 of 1

Author:  DJDD [ Tue Mar 08, 2011 8:34 am ]
Post subject:  Visual Studio 2010 Warnings

Hi,
I've recently built PolyVox in Visual Studio 2010, and after wrestling with the cmake stuff every seems to have gone well except for the below.

Any ideas what the following warning mean?
Code:
Warning   1   warning C4251: 'PolyVox::Region::m_v3dLowerCorner' : class 'PolyVox::Vector<Size,Type>' needs to have dll-interface to be used by clients of class 'PolyVox::Region'   Region.h   60
Warning   2   warning C4251: 'PolyVox::Region::m_v3dUpperCorner' : class 'PolyVox::Vector<Size,Type>' needs to have dll-interface to be used by clients of class 'PolyVox::Region'   Region.h   61
Warning   3   warning C4251: 'PolyVox::PositionMaterial::position' : class 'PolyVox::Vector<Size,Type>' needs to have dll-interface to be used by clients of class 'PolyVox::PositionMaterial'   VertexTypes.h   48
Warning   4   warning C4251: 'PolyVox::PositionMaterialNormal::position' : class 'PolyVox::Vector<Size,Type>' needs to have dll-interface to be used by clients of class 'PolyVox::PositionMaterialNormal'   VertexTypes.h   70
Warning   5   warning C4251: 'PolyVox::PositionMaterialNormal::normal' : class 'PolyVox::Vector<Size,Type>' needs to have dll-interface to be used by clients of class 'PolyVox::PositionMaterialNormal'   VertexTypes.h   71


The development environment I've setup in VS2010 I think is a bit weird - I'm not sure if I'm using the DLLs or compiling the PolyVox code directly into my project. Any tips on how I should set it up?

Author:  beyzend [ Tue Mar 08, 2011 5:57 pm ]
Post subject:  Re: Visual Studio 2010 Warnings

In my current setup I don't have CMake setup so I'm using a manually created VS10 solution file. With PolyVox I use the default CMake settings for it to build a solution which builds a dynamic DLL lib. Then in my own projection solution, in application properities, under c++ I include the path for the headers, under linker, I include the path for polyvox .lib files, and for linker->input I make sure I have the polyvox*.lib there also.

Edit: WAIT! I also have those warnings when I build PolyVox. I'm not sure what is up with that I will have to google it when I have time. I can say that I haven't had any problems using linking and using PolyVox with those errors.

Author:  David Williams [ Tue Mar 08, 2011 7:22 pm ]
Post subject:  Re: Visual Studio 2010 Warnings

The warnings aren't a problem - But I should probably suppress them with a #pragma because they are distracting. They occur because the Region class is exported to the .dll, but it uses the Vector class is used in its interface and the Vector class is not eported to the .dll. Hence it's warning you that you might not be able to access the Vector class which you need to use the Region.

However, the Vector class is actually header-only (because it's templatised) so it doesn't actually need to be in the .dll. Client code can use it directly from the headers.

As for actually using PolyVox you have two options. You can build it as a .dll and .lib, then link against this .lib when you build your project. Alternatively you can copy the various source files into your own project, add them to your Visual Studio solution, and compile them as part of your project.

Overall you are best off linking against the library, because then it is much easier to keep up to date as new versions come out.

On a related note, we plan to release an SDK but it won't be for a while yet.

Author:  DJDD [ Tue Mar 08, 2011 9:57 pm ]
Post subject:  Re: Visual Studio 2010 Warnings

Hrm, I'll check out my project setup. Thanks for the advice.

One other thing, PolyVox has a whole bunch of type casting issues:
Code:
Warning   17   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   65
Warning   18   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   66
Warning   19   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   67
Warning   20   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   68
Warning   21   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   77
Warning   22   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   78
Warning   23   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   79
Warning   24   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   80
Warning   25   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   91
Warning   26   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   92
Warning   27   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   93
Warning   28   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   94
Warning   29   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   103
Warning   30   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   104
Warning   31   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   105
Warning   32   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   106
Warning   33   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   117
Warning   34   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   118
Warning   35   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   119
Warning   36   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   120
Warning   37   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   129
Warning   38   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   130
Warning   39   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   131
Warning   40   warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data   CubicSurfaceExtractorWithNormals.inl   132


I know they're not an issue. But for the sake of cleanliness it might be worth casting them properly or #pragma'ing the warnings out.

Author:  David Williams [ Tue Mar 08, 2011 10:16 pm ]
Post subject:  Re: Visual Studio 2010 Warnings

Yeah, I do agree, there's a lot of warnings which really should be fixed. At the moment the focus is on the streaming volume support, but I think after that we plan to stop adding features and polish up what we have for a proper release. This involves fixing the warnings, but I'd also like to run the code through lint/valgrind/gpof/etc to see what else gets identified.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/