I get an error when compiling a clean source from a premade VS project for TPT++ after following all of your instructions on the wiki page:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(2482,40): error C2338: Windows headers require the default packing option. Changing this can lead to memory corruption. This diagnostic can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined.
It terminates the build process. Anything I can do to stop it?
(I originally posted this in the development section, before I realised I should have posted it here.)
Thanks!
EDIT:
While I was compiling, I came across another error:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xtgmath.h(22,47): warning C4244: '=': conversion from 'double' to 'int', possible loss of data (compiling source file src\simulation\elements\SPRK.cpp)
SOLUTION:
Fix error C2338: setting /Zp to default doesn't work - add WINDOWS_IGNORE_PACKING_MISMATCH to C++ > Preprocessor > Preprocessor definitions and it should bypass that.
Fix error C4244: this seemed to show up even if 'treat warnings as errors' was set to 'No'. I found it worked if I set 'warning level' to 'None'.
OK, thanks a lot! I have already disabled the 'treat warnings as errors' option, but I'll try to find /Zp and see if that fixes it. If it doesn't, I'll define the WINDOWS_IGNORE_PACKING_MISMATCH thing.
Thanks again!
Right, so setting /Zp to 16 bytes (if you have that option) got past that problem, now I have a new one:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xtgmath.h(22,47): warning C4244: '=': conversion from 'double' to 'int', possible loss of data (compiling source file src\simulation\elements\SPRK.cpp)
It appeared for SOAP (conversion from 'double' to 'float'), and Gravity ('double' to 'float') as well.
Thanks!
'treat warnings as errors' doesn't fix it (I've tried all the options) and 'turn off all warnings' on 'warning level' (/W) doesn't either. Also, when I have /Zp set to 16, which previously fixed the 'default packing option' it still brings up that error.
Thanks!
I have pasted 3 builds with different property combinations at https://bpaste.net/show/G7PW4.
Thanks!