[osg-users] Compilation error with MSVC 2015

Jan Ciger jan.ciger at gmail.com
Mon Jul 4 09:05:33 PDT 2016


On Mon, Jul 4, 2016 at 4:29 PM, Robert Osfield <robert.osfield at gmail.com>

> Hi Jan,
> On 4 July 2016 at 14:12, Jan Ciger <jan.ciger at gmail.com> wrote:
> > It was a fresh checkout from Github master from a few minutes ago. I have
> > modified the main CMakeLists.txt and added /bigobj, as mentioned in the
> > error message, to CMAKE_CXX_FLAGS for MSVC and now the same code seems to
> > build fine,so that doesn't look like a corrupted file. I was building a
> > debug build when I have got that error, not sure whether it has any
> > relevance.
> Weird.  I have just had a look t the source file the compiler is
> complaining about and it looks pretty standard.
> The gles plugin on Linux is not particularly large either. I can't see
> any obvious reasons why there would be any need for some special
> options.
> What size are the object files and resulting osgdb_gles.dll?

The OpenGLESGeometryOptimizer.obj is 4.84MB in Release and 28.81MB in
Debug, the remaining files are few hundred kB (Release), few megs (in

The DLL is 770kB in release and 3.84MB in debug.

I have noticed that the incremental linking was off in the CMakeLists.txt
for MSVC, that could perhaps have an impact.

Can the option just been added to the gles pugin if absolutely required?

Yes, possibly. However, it may be that the build would break elsewhere too
- I didn't have time to rebuild the whole mess several times today, so I
have put it only globally. I don't think that the GLES code is somehow

> Right now, it seems pretty odd that the gles plugin would break some
> compiler limits that we've never hit before in any other module or
> plugins, so I'm inclined to think there is something specific going
> on, perhaps a bug with the compiler that is throwing things off.

Yes, I wouldn't be surprised. Or it could be triggering generation of ton
of code in 2015 that exceeds the limits. MSVC 2015 broke a lot of code that
was compiling before, because it is both stricter and updated for newer C++
standard. So when rebuilding older C++ code I am now often troubleshooting
compilation failures about code referencing deleted functions, template
problems, you name it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160704/38aa0a2d/attachment-0003.htm>

More information about the osg-users mailing list