From e7c43ce2420a46bebc170d70f2729384f8065510 Mon Sep 17 00:00:00 2001 From: reworks Date: Sat, 17 Feb 2018 23:10:07 +0800 Subject: [PATCH] Docs note that MSVC Compilers may require /bigobj (#591) * Note that MSVC Compilers may require /bigobj So when making heavy use of headers or templates, MSVC will error with ["Fatal Error C1128"](https://msdn.microsoft.com/en-us/library/8578y171.aspx). The solution is to use the [/bigobj](https://msdn.microsoft.com/en-us/library/ms173499.aspx) flag. This does, however, mean that, as per msvc docs, "Linkers that shipped prior to Visual C++ 2005 cannot read .obj files that were produced with /bigobj". * Update usertype.rst --- docs/source/api/usertype.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/source/api/usertype.rst b/docs/source/api/usertype.rst index e67b34c9..3802cbb6 100644 --- a/docs/source/api/usertype.rst +++ b/docs/source/api/usertype.rst @@ -402,6 +402,13 @@ performance note Note that performance for member function calls goes down by a fixed overhead if you also bind variables as well as member functions. This is purely a limitation of the Lua implementation and there is, unfortunately, nothing that can be done about it. If you bind only functions and no variables, however, Sol will automatically optimize the Lua runtime and give you the maximum performance possible. *Please consider ease of use and maintenance of code before you make everything into functions.* +MSVC note +--------- + +.. note:: + + When using usertype templates extensively, MSVC may invoke `compiler error C1128 `_ , which is solved by using the `/bigobj compilation flag `_. + .. _destructible: http://en.cppreference.com/w/cpp/types/is_destructible .. _default_constructible: http://en.cppreference.com/w/cpp/types/is_constructible .. _runtime extensible: https://github.com/ThePhD/sol2/blob/develop/examples/usertype_advanced.cpp#L81