Error while trying to compile with scons

  • player4444
    25th Feb 2019 Member 0 Permalink

    Strange I put the zip after deleting Lua5.2 and the other luas. I'll see when I get home today.

  • player4444
    19th Mar 2019 Member 0 Permalink

    I'm back. I got:

     

     

    g++ -o build\src\lua\LuaCheckbox.o -c -std=c++11 -U__STRICT_ANSI__ -Wno-invalid-offsetof -msse -msse2 -DSDL_INC -DLUA_R_INCL -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\data -Idata -Ibuild\generated -Igenerated src\lua\LuaCheckbox.cpp
    =====
    In file included from src\lua\LuaCheckbox.h:3:0,
    from src\lua\LuaCheckbox.cpp:4:
    src\lua\LuaLuna.h: In static member function 'static bool Luna<T>::checkType(lua_State*, int, const char*)':
    src\lua\LuaLuna.h:100:28: error: there are no arguments to 'lua_equal' that depend on a template parameter, so a declaration of 'lua_equal' must be available [-fpermissive]
    res = lua_equal(L, -2, -1);
    ^
    src\lua\LuaLuna.h:100:28: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

    =====
    scons: *** [build\src\lua\LuaCheckbox.o] Error 1
    =====
    In file included from src\lua\LuaButton.h:3:0,
    from src\lua\LuaButton.cpp:4:
    src\lua\LuaLuna.h: In static member function 'static bool Luna<T>::checkType(lua_State*, int, const char*)':
    src\lua\LuaLuna.h:100:28: error: there are no arguments to 'lua_equal' that depend on a template parameter, so a declaration of 'lua_equal' must be available [-fpermissive]
    res = lua_equal(L, -2, -1);
    ^
    src\lua\LuaLuna.h:100:28: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

    =====
    scons: *** [build\src\lua\LuaButton.o] Error 1
    scons: building terminated because of errors.
    strip: 'build/Powder.exe': No such file

    Edited once by player4444. Last: 19th Mar 2019
  • jacob1
    19th Mar 2019 Developer 0 Permalink
    @player4444 (View Post)
    You appear to have Lua 5.3 (or 5.2?) headers somewhere in your include path. The guide provides the lua5.1/ folder with the 5.1 headers, but it seems you have the 5.3 headers somewhere, causing compile errors. You should find where those are and remove them.

    If using Lua 5.2, I think (?) you need to define LUA_COMPAT_ALL. But you should just try to use the 5.1 the guide provides.
    Edited once by jacob1. Last: 19th Mar 2019
  • player4444
    19th Mar 2019 Member 0 Permalink

    Quick question: Does each LUA (ex. 5.1, 5.2) have different syntax rules like python(ex. 2.7, 3.6)?

     

    edit: Odd, I deleted all LUA, including 5.1, and reinstalled it, and still get this, it may be in another path.

    2nd edit: Let me check variables.

    Edited 2 times by player4444. Last: 19th Mar 2019
  • jacob1
    19th Mar 2019 Developer 0 Permalink
    @player4444 (View Post)
    There's some functions added, and some functions removed / deprecated in later version. This applies both to the language, and to the C api. You're having difficulties with the C api changing. TPT can only be compiled with 5.1 or 5.2, not 5.3.

    Most / all TPT scripts won't break with 5.1, they should work fine.

    Edit: don't "install" lua. Just follow the guide, all you have to do is copy the lib/ and include/ folders into C:\MinGW
    I recommend deleting all "installed" Luas unless you need them for something else.
    Edited 2 times by jacob1. Last: 19th Mar 2019
  • player4444
    19th Mar 2019 Member 0 Permalink

    Sorry, I by "install" I mean copy them into the folders.

  • jacob1
    19th Mar 2019 Developer 0 Permalink
    @player4444 (View Post)
    The only other thing I can think of, if C:\MinGW isn't your MinGW install directory you may have to put it somewhere else.

    Have you considered the visual studio guide? It's more supported than MinGW. I want to support MinGW again but I haven't had time to redo the guide.
  • player4444
    19th Mar 2019 Member 0 Permalink

    God damn it, I was looking in Python27, not MINGW, that was the problem. BUT I KEEP GETTING ERRORS ;-;

     

     

    g++ -o build\src\json\jsoncpp.o -c -std=c++11 -U__STRICT_ANSI__ -Wno-invalid-offsetof -msse -msse2 -DSDL_INC -DLUA_R_INCL -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\data -Idata -Ibuild\generated -Igenerated src\json\jsoncpp.cpp
    =====
    In file included from src/lua/LuaScriptInterface.h:4:0,
    from src\graphics\Renderer.cpp:19:
    src/lua/LuaCompat.h:10:17: fatal error: lua.h: No such file or directory
    #include "lua.h"
    ^
    compilation terminated.

    =====
    scons: *** [build\src\graphics\Renderer.o] Error 1
    scons: building terminated because of errors.
    strip: 'build/Powder.exe': No such file

     

    Edit: From working with C in past, I'm going to try to change the " "  to <>

    Edit 2: Wait I think theres suppossed to be a Lua headder in that directory, Imma check the TPT Source Code.

    Edited 2 times by player4444. Last: 19th Mar 2019
  • jacob1
    19th Mar 2019 Developer 0 Permalink
    @player4444 (View Post)
    " " and < > are irrelevant. They are just used to make it clearer if it's from a standard library or your own project.

    Anyway, now it sounds like you deleted lua :P. So now it can't find the headers at all. You'll need to copy them into that folder again.


    Edit:
    Can you connect to IRC?
    Here's a guide: https://powdertoy.co.uk/Wiki/W/Irc_setup.html
    If you don't want to bother installing a client, use the Freenode webchat link.
    It will help this go a lot faster.
    Edited 2 times by jacob1. Last: 19th Mar 2019
  • player4444
    23rd Mar 2019 Member 0 Permalink

    I've reinstalled MINGW and now I get the error:

     

    c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -llua