[2.1] Compiler crashes on MSVC 2019

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
xissburg
Halfling
Posts: 72
Joined: Sun Feb 21, 2010 4:58 pm
x 15

[2.1] Compiler crashes on MSVC 2019

Post by xissburg » Sun May 26, 2019 6:32 pm

I'm just posting this here in case someone else has a similar issue. When attempting to build Ogre on Visual Studio 2019 16.1.1 I am getting errors such as:

Code: Select all

1>    INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX64\x64\CL.exe'
1>        Please choose the Technical Support command on the Visual C++
1>        Help menu, or open the Technical Support help file for more information
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreItem.cpp(275,51): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreItem.cpp(275,51): warning C4267: cl : Command line error D8040 : error creating or communicating with child process
1>    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(429,5): error MSB6006: "CL.exe" exited with code 2.
1>  Done executing task "CL" -- FAILED.

Code: Select all

C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMeshManager.cpp(1040,59): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMeshManager.cpp(1056,123): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMeshManager.cpp(1075,87): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMesh2.cpp(546,56): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMesh.cpp(1127,66): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMesh.cpp(1132,88): warning C4267:  'argument': conversion from 'size_t' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMesh.cpp(1410,45): warning C4244:  'initializing': conversion from '__int64' to 'unsigned short', possible loss of data
1>    C:\Users\xissb\Documents\Ogre\OgreMain\src\OgreMesh.cpp(1410,45): warning C4244: cl : Command line error D8040 : error creating or communicating with child process
1>    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(429,5): error MSB6006: "CL.exe" exited with code 2.
1>  Done executing task "CL" -- FAILED.
It seems to happen after encountering type conversion warnings. Searching for similar errors on the web I found similar reports of crashing when the compiler find things such as the returned type not being exactly the same as the type in the function declaration.

Anyways, the solution was to install Visual Studio 2017 and it's now building everything.
Last edited by xissburg on Wed May 29, 2019 1:13 am, edited 1 time in total.
2 x

User avatar
TaaTT4
OGRE Contributor
OGRE Contributor
Posts: 172
Joined: Wed Apr 23, 2014 3:49 pm
x 18

Re: [2.1] Compiler creashes on MSVC 2019

Post by TaaTT4 » Mon May 27, 2019 8:52 am

I'm interested in switching to Visual Studio 2019 myself. Could you please warn me if/when this issue will be solved by a future update?
Thanks!
0 x
Senior game programmer at Vae Victis
Working on Racecraft

xissburg
Halfling
Posts: 72
Joined: Sun Feb 21, 2010 4:58 pm
x 15

Re: [2.1] Compiler crashes on MSVC 2019

Post by xissburg » Mon May 27, 2019 5:10 pm

MSVC 2017 is working for me for now so I don't see reason to worry about MSVC 2019. I might post updates in case it stops crashing in the future.
0 x

hyyou
Gremlin
Posts: 166
Joined: Wed Feb 03, 2016 2:24 am
x 6
Contact:

Re: [2.1] Compiler crashes on MSVC 2019

Post by hyyou » Mon Jul 15, 2019 3:01 am

xissburg (OP), does it also happen when Optimization is turn off?

------

After I tried to make my old Ogre projects runable again, I find some problems with VS2019.

1. NULL undefined in Remotery.c
I solved it by adding #include <stdio.h> near the first line.

2. Then, I got TLS_OUT_OF_INDEXES undefined in Remotery.c
I solved it by adding #include <processthreadsapi.h> near the first line.

3. There are other few places e.g. interlockedapi.h. It is also about xxx undefined. Too lazy to fix.

Some issues are caused by my uninstallation of VS2017. They can be solved by repair VS2019.
However, some are persist. The problematic project is mostly Remotery.
I think Remotery uses deprecated Visual C++ feature.

From a rough search, some variables are in some files in C:\Program Files (x86)\Windows Kits\8.1,
but not in Windows Kits\10.0.

From statistic, most Ogre issues in my computer are caused by me though.
0 x

duck2
Gnoblar
Posts: 1
Joined: Wed Jul 31, 2019 11:45 am
x 2

Re: [2.1] Compiler crashes on MSVC 2019

Post by duck2 » Wed Jul 31, 2019 12:23 pm

Finally, MSVC 2019 16.2.0 (latest update) successfully compile Ogre with some changes.
The generated default solution from CMAKE will produce this errors:

Code: Select all

1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001:  An internal error has occurred in the compiler.
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001: (compiler file 'msc1.cpp', line 1519)
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001:  To work around this problem, try simplifying or changing the program near the locations listed above.
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001: Please choose the Technical Support command on the Visual C++
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001:  Help menu, or open the Technical Support help file for more information
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001: INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX64\x86\CL.exe'
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001:     Please choose the Technical Support command on the Visual C++
1>D:\Dependencies\OGRE\OgreMain\src\OgreImageDownsampler.cpp(196,14): error C1001:     Help menu, or open the Technical Support help file for more information
1>D:\Dependencies\OGRE\OgreMain\src\OgreImage2.cpp(65): warning C4717:  'Ogre::Image2::Image2': recursive on all control paths, function will cause runtime stack overflow
1>D:\Dependencies\OGRE\OgreMain\src\OgreImage2.cpp(65): warning C4717: cl : Command line error D8040 : error creating or communicating with child process
Disable precompiled header from OgreMain will solve this issue.
Looks like this is caused by recursive #include.
Nothing wrong with the code, it just buggy compiler.
2 x

Post Reply