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 »

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
the file in the path
the file in the path
Capture.PNG (63.27 KiB) Viewed 7268 times


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

Thanks
User avatar
zorg
Party member
Posts: 3441
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 »

"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 »

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: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

It always loads the main.lua file.
User avatar
zorg
Party member
Posts: 3441
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 »

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 »

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"?
User avatar
NotARaptor
Citizen
Posts: 59
Joined: Thu Feb 22, 2018 3:15 pm

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

Post by NotARaptor »

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 »

all good thanks!
im more into checking the love2d infra , less how lua works
User avatar
zorg
Party member
Posts: 3441
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 »

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.
User avatar
NotARaptor
Citizen
Posts: 59
Joined: Thu Feb 22, 2018 3:15 pm

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

Post by NotARaptor »

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 33 guests