getting : boot.lua:481: Cannot load game at path in windows

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
umen
Prole
Posts: 8
Joined: Mon Apr 30, 2018 6:44 am

getting : boot.lua:481: Cannot load game at path in windows

Post by umen » Wed May 16, 2018 7:00 pm

Hello all
i compile the engine and try to load simple lua script but i keep getting

Code: Select all

Error

boot.lua:481: Cannot load game at path 'D:/Dev/my/cpp/2d/love2d/main.lua'.
Make sure a folder exists at the specified path.


Traceback

[C]: in function 'error'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
Im using visual studio 2017
as you can see the file exist
Capture.PNG
the file in the path
Capture.PNG (63.27 KiB) Viewed 183 times


also in VS i defined the file like this :
Capture2.PNG
vs config
Capture2.PNG (121.33 KiB) Viewed 183 times
what can be the problem ?
where to debug and check why the file doesn't load ?

Thanks

User avatar
zorg
Party member
Posts: 2249
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by zorg » Wed May 16, 2018 7:05 pm

"Make sure a folder exists at the specified path."
Folder, not file.
You want D:\Dev\my\cpp\2d\love2d\ instead of D:\Dev\my\cpp\2d\love2d\main.lua
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

umen
Prole
Posts: 8
Joined: Mon Apr 30, 2018 6:44 am

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by umen » Thu May 17, 2018 6:33 am

Thanks it is working I thought it need the main.lua file as arg , how does it know what lua file to load ?

User avatar
raidho36
Party member
Posts: 1666
Joined: Mon Jun 17, 2013 12:00 pm

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by raidho36 » Thu May 17, 2018 6:40 am

It always loads the main.lua file.

User avatar
zorg
Party member
Posts: 2249
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by zorg » Thu May 17, 2018 7:20 am

Just like with C and a lot of other languages, might i add; main is usually the entrypoint.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

umen
Prole
Posts: 8
Joined: Mon Apr 30, 2018 6:44 am

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by umen » Thu May 17, 2018 7:37 am

i dont know lua , but in C / java / what ever you dont need your file named "main"
the entry point only is "main"
what if i want my game file called "myGame.lua"?

NotARaptor
Prole
Posts: 34
Joined: Thu Feb 22, 2018 3:15 pm

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by NotARaptor » Thu May 17, 2018 8:06 am

A completed project will contain several .lua files, and it needs to be able to determine which is the entry point. Remember that a .love file is actually a .zip containing all the source files and resources. Love2d does this by specifying that the file called "main.lua" is the entry point.

In C it's slightly different - each .c file is compiled to a .obj file by the compiler, and then linked together by the linker - the linker finds which .obj file contains the "main" function and makes that the entrypoint. The Love2d/Lua system can't possibly work like this - for one thing you could have two different .lua files that each define a function of the same name! If you tried this in C, it would barf at the linker stage.

So, to sum up... the FOLDER is what Love2d sees as the "application" (whether it's zipped or not), and the main.lua file is the entry point.

I use Windows too (cue the "booo!" sounds), but prefer working with a flat text editor rather than an IDE. So I fired up regedit and added an entry to the directory background context menu, and the directory object context menu to run the folder with Love2d. So I just right-click in the background of the Windows Explorer and select "Run with Love2d" and it runs the project... simple.

umen
Prole
Posts: 8
Joined: Mon Apr 30, 2018 6:44 am

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by umen » Thu May 17, 2018 8:53 am

all good thanks!
im more into checking the love2d infra , less how lua works

User avatar
zorg
Party member
Posts: 2249
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by zorg » Thu May 17, 2018 8:55 am

umen wrote:
Thu May 17, 2018 7:37 am
i dont know lua , but in C / java / what ever you dont need your file named "main"
the entry point only is "main"
what if i want my game file called "myGame.lua"?
Then you'd name your love file (which is a zip) myGame.love
NotARaptor wrote:
Thu May 17, 2018 8:06 am
So, to sum up... the FOLDER is what Love2d sees as the "application" (whether it's zipped or not), and the main.lua file is the entry point.
One thing though, you zip up the contents of the folder, not the folder itself.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

NotARaptor
Prole
Posts: 34
Joined: Thu Feb 22, 2018 3:15 pm

Re: getting : boot.lua:481: Cannot load game at path in windows

Post by NotARaptor » Thu May 17, 2018 9:06 am

zorg wrote:One thing though, you zip up the contents of the folder, not the folder itself.
Good point!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests