Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Attempt to index a nil value in premake.lua

I have made a premake.lua file for mye C++ Game Engine. But when i run premake5.exe vs2017 i get the error:
Game Engine/premake5.lua:35: attempt to index a nil value
if i go to line 35 where it complaines i see this:

34  filter "system:windows":
35      cppdialect "C++17"
36      staticruntime "On"
37      systemversion "latest"

i found out that if i comment out line 34 it seems to work but then proceedes to giving the same error on line 49:

49  filter "configurations:Debug": 
50      defines "BZ_DEBUG"
51      symbols "On"

if i at try to comment out all my filter fields. i get this error:
Error: [string "return cfg-architecture"]:1: attempt to perform arithmetic on a table value (global 'cfg') in token: cfg-architecture

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

i have tried multiple versions of premake and have tried to compile multiple with different vs versions. But i get the same result every time.

>Solution :

You have extra : after your string in filter. so you try to call "some_string":cppdialect("C++17") and string doesn’t have that method.

Your code should be

filter "system:windows"
    cppdialect "C++17"
    staticruntime "On"
    systemversion "latest"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading