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
Capture.PNG (63.27 KiB) Viewed 7663 times
also in VS i defined the file like this :
vs config
Capture2.PNG (121.33 KiB) Viewed 7663 times
what can be the problem ?
where to debug and check why the file doesn't load ?
"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 True 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.
Just like with C and a lot of other languages, might i add; main is usually the entrypoint.
Me and my stuff True 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.
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"?
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 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 True 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.