al2950 wrote:Klaim wrote:I think the UnityBuild might greatly impact this problem...
I thought that was a very good point, however I tried it and it didnt seem to improve! I am not sure how to go about this issue. Your fix for the header guards was correct, however that number of warnings is not acceptable! We could just disable those warnings project wide (ugly solution), or go through all the code and add the header prefix & suffix to the appropriate headers where they are missing (painful solution!).
Ok let me help you: I cannot try yet the lest Ogre 1.8 version, but I know have a similar warning problem with my current project.
A very simple way to fix this is to add:
Code: Select all
if( MSVC )
# Deactivate warning C4251
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251" )
endif()
somewhere in the CMake files, maybe the root one is the best place, or maybe in one of the project definition macros.
It work in my project (with MSVC) so it should work for you too.
However, this fix only one warning. You can add the others that are deactivated in the header.
I think this kind of stuffs should definitively be moved in CMake. That said it should (I think) trigger the same warning in client code of Ogre. I'm not sure though.
That said, if using Ogre, the client code still have no other choice than using STL in the interface so it should be ok let the client code disable the warnings too.