perbone / luascript

Lua language support for Godot Engine
Apache License 2.0
633 stars 45 forks source link

Support for Visual Studio #6

Closed ShoesForClues closed 5 years ago

ShoesForClues commented 5 years ago

Just changed a few lines.

perbone commented 5 years ago

Got the following error compiling on linux with llvm 8

[ 23%] Compiling ==> modules/luascript/luascript.cpp modules/luascript/debug.cpp:28:7: error: cannot initialize a variable of type 'char' with an rvalue of type 'char *' char fmtbuf=new char[fmt.size()]; ^ ~~~~ [ 23%] Compiling ==> modules/luascript/register_types.cpp [ 24%] 1 error generated. [ 25%] Compiling ==> modules/luascript/editor/luascript_syntax_highlighter.cpp [ 28%] Compiling ==> modules/mbedtls/register_types.cpp scons: *** [modules/luascript/debug.x11.tools.64.llvm.o] Error 1 scons: building terminated because of errors.

perbone commented 5 years ago

Got the following error on linux with g++ 8.3

21%] Compiling ==> modules/luascript/debug.cpp [ 34%] modules/luascript/debug.cpp: In function 'void print_debug(String, ...)': modules/luascript/debug.cpp:28:33: error: invalid conversion from 'char' to 'char' [-fpermissive] char fmtbuf=new char[fmt.size()]; ^ modules/luascript/debug.cpp:32:11: error: invalid conversion from 'char' to 'char' [-fpermissive] wcstombs(fmtbuf, fmt.c_str(), fmt.size()); ^~ In file included from /usr/include/c++/8/cstdlib:75, from modules/luascript/debug.cpp:20: /usr/include/stdlib.h:933:42: note: initializing argument 1 of 'size_t wcstombs(char, const wchar_t, size_t)' extern size_t wcstombs (char *restrict s,


[ 34%] modules/luascript/debug.cpp:39:17: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
  strcat(tmpbuf, fmtbuf);
                 ^~~~~~
In file included from ./core/cowdata.h:34,
                 from ./core/ustring.h:35,
                 from ./core/math/vector2.h:35,
                 from ./core/math/rect2.h:34,
                 from ./core/math/transform_2d.h:34,
                 from ./core/os/input_event.h:34,
                 from ./core/os/main_loop.h:34,
                 from ./core/engine.h:35,
                 from ./core/os/os.h:34,
                 from modules/luascript/debug.h:26,
                 from modules/luascript/debug.cpp:22:
/usr/include/string.h:129:70: note:   initializing argument 2 of 'char* strcat(char*, const char*)'
 extern char *strcat (char *__restrict __dest, const char *__restrict __src)
                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
[100%] progress_finish(["progress_finish"], [])
[100%] scons: *** [modules/luascript/debug.x11.tools.64.o] Error 1
scons: building terminated because of errors.
ShoesForClues commented 5 years ago

Oh! Yeah, sorry I meant to put char* fmtbuf