Compilation errors in Visual C++ November 2013 CTP
« on: 08 May 2015, 12:36:01 »
Hi,

When I tried to compile tgui from branch v0.7-dev in Visual Studio 2013 using Visual C++ November 2013 CTP i received strange errors. Any ideas how it repair ? I add, using default compiler, there are no errors.

Code: [Select]
c:\prywatne\git\space-explorers\tgui\src\tgui\listbox.cpp(215): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\ehexcept.c', line 956)

1>C:\Prywatne\git\Space-Explorers\TGUI\include\TGUI/Gui.hpp(455): error C2783: 'std::shared_ptr<_Ty> std::make_shared(_Types &&...)' : could not deduce template argument for '_Ty'
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1000) : see declaration of 'std::make_shared'


Here is build log:

Code: [Select]
1>------ Build started: Project: TGUI (Libs\TGUI\TGUI), Configuration: Debug x64 ------
1>  Widget.cpp
1>  Transformable.cpp
1>  Tooltip.cpp
1>  ThemeFileParser.cpp
1>src\TGUI\ThemeFileParser.cpp(125): warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data
1>  TextureManager.cpp
1>src\TGUI\TextureManager.cpp(150): warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data
1>  Texture.cpp
1>src\TGUI\Texture.cpp(336): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\Texture.cpp(374): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>  TextBox.cpp
1>src\TGUI\TextBox.cpp(332): warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(346): warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(530): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(707): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(734): warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(790): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(821): warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(882): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(922): warning C4267: '+=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1074): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1095): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1105): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1126): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1139): warning C4267: '+=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1254): warning C4244: 'argument' : conversion from 'sf::Uint32' to 'char', possible loss of data
1>src\TGUI\TextBox.cpp(1257): warning C4244: 'argument' : conversion from 'sf::Uint32' to 'char', possible loss of data
1>src\TGUI\TextBox.cpp(1275): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1280): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1282): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1291): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1296): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1298): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1331): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\TextBox.cpp(1340): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>  Tab.cpp
1>C:\Prywatne\git\Space-Explorers\TGUI\include\TGUI/Tab.hpp(366): warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\Tab.cpp(154): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\Tab.cpp(157): warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\Tab.cpp(166): warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>  SpinButton.cpp
1>  Slider.cpp
1>  Signal.cpp
1>  Scrollbar.cpp
1>  RadioButton.cpp
1>  ProgressBar.cpp
1>  Picture.cpp
1>  Panel.cpp
1>  MessageBox.cpp
1>  MenuBar.cpp
1>  ListBox.cpp
1>C:\Prywatne\git\Space-Explorers\TGUI\include\TGUI/ListBox.hpp(381): warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\ListBox.cpp(237): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\ListBox.cpp(373): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\ListBox.cpp(523): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\ListBox.cpp(546): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\ListBox.cpp(948): warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>src\TGUI\ListBox.cpp(1129): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>  Layout.cpp
1>C:\Prywatne\git\Space-Explorers\TGUI\include\TGUI/Gui.hpp(455): error C2783: 'std::shared_ptr<_Ty> std::make_shared(_Types &&...)' : could not deduce template argument for '_Ty'
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1000) : see declaration of 'std::make_shared'
1>  Generating Code...
1>c:\prywatne\git\space-explorers\tgui\src\tgui\listbox.cpp(215): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\ehexcept.c', line 956)
1>   To work around this problem, try simplifying or changing the program near the locations listed above.
1>  Please choose the Technical Support command on the Visual C++
1>   Help menu, or open the Technical Support help file for more information
========== Build: 0 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========


*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: Compilation errors in Visual C++ November 2013 CTP
« Reply #1 on: 08 May 2015, 15:37:33 »
This is just a bug in the old compiler, or something that wasn't implemented at that time.

If this is the only error then you can fix it by changing the line to
GuiContainer::Ptr m_container = std::shared_ptr<GuiContainer>(new GuiContainer());

Although TGUI v0.7 supports the compiler from VS2013, I will not adapt my code to older compiler versions, I only guarantee support for up-to-date VS versions.
« Last Edit: 08 May 2015, 15:41:21 by texus »