"No such file: CoreLibs/sprites" when trying to compile

Hey, I was trying out the examples provided in the SDK, but I could not compile Level 1-1 among other examples, because they could not find CoreLibs/sprites, but I checked, and sprites.lua is there. I'm guessing they found other files in this directory, because I didn't get errors on those (yet), which makes this whole thing more confusing to me. This is what I punched into the command line (and what it spew out) :

sudo ./pdc /home/matthias/Downloads/PlaydateSDK-1.9.0/Examples/Level\ 1-1/Source ~/Downloads/PlaydateSDK-1.9.0/Examples/Level1-1.pdx
error: /home/matthias/Downloads/PlaydateSDK-1.9.0/Examples/Level 1-1/Source/main.lua:55: No such file: CoreLibs/sprites

I probably made a mistake here - any help is appreciated :slight_smile:
(yes - I still have it in the Downloads Foler - I am lazy haha)

Are you using macOS or Linux?

Maybe the SDK was not properly installed so it cannot find the library. CoreLibs/sprites is just Lua files that are part of the SDK so if pdc throws an error it indicates it cannot find it.

On Mac the SDK Path is usually set in ~/.Playdate/config but the installer is doing it for you. In theory you don't have to care about it.

Did you set PLAYDATE_SDK_PATH Environment Variable? See "Inside Playdate" 3.3. Compiling a project

2 Likes

Was just having a similar issue compiling. On Windows I needed to add the PlaydateSDK\bin\ directory to Path to use the pdc command, but the PLAYDATE_SDK_PATH Environment Variable needs to be set to the PlaydateSDK directory itself. Then I was able to compile an example game for the first time.

2 Likes

This may be problem that env variable points to /bin folder, but code is trying to get /CoreLibs folder that is one layer above

I'm using linux, but I'm not that great (beginner).

I've read the documentation a bit, and found both ~/.bash_profile and ~/.bashrc, so I put it (export PLAYDATE_SDK_PATH=/home/matthias/Downloads/PlaydateSDK-1.9.0/) in both files - without success. Maybe I misunderstood something there?

You have to source them or close your Terminal and re-open it before the new values from your profile files are read. Did you happen to do that?

well, I rebooted (after the change), so that should not be the problem.......right?

Yeah, that should certainly do it. Try using the -sdkpath pdc arg and see if that works for you....

Interesting: It seems to work this way!
Now I need to figure out how to actually set the right path!

I would like to get a deeper understanding about the relationship between ~/.Playdate/config and the PLAYDATE_SDK_PATH environmental variable. When set, both point to the same target. I assume that either needs to be set. If that's the case, what's the order of precendence?