Attempting to build a C example (such as Hello World or Life are ones I have tested) compiles. Attempting to run it in the Playdate Simulator gives me the following error.
I cannot directly attach the PDX due to being a new user.
Attempting to build a C example (such as Hello World or Life are ones I have tested) compiles. Attempting to run it in the Playdate Simulator gives me the following error.
I cannot directly attach the PDX due to being a new user.
Does the pdex.dll exist inside your pdx?
If not, please check your build environment/setup.
There is indeed pdex.dll inside.
If it helps, I am building using the CMake & NMake method.
I'll also note that making a regular Lua project and running it in the simulator works fine.
Error 193 is architecture mis-match. It looks like you probably built an ARM build instead of x86_64 for the Simulator.
Ah, I've realized the problem with your help and that was half-right. Not ARM, but my VSCode was misconfigured and was not launching the 64 bit developer command prompt.
For anyone else doing the same as me, this will change the default cmd in vscode to be the amd64 developer command prompt. (Goes in your settings.json, change install path for vs if relevant)
"terminal.integrated.profiles.windows": {
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [
"/K",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat",
"-arch=amd64"
],
"icon": "terminal-cmd"
}
},
Thanks for the help. The error in the Simulator could be made a little more informative though (or have somewhere we could look in the documentation for error codes?)
@jamily Glad you got it sorted out. The error log message from the Simulator is supposed to tip you off (saying it's the wrong arch) but for whatever reason it didn't come through. I adjusted that today to hopefully make it though next time. The error code comes from Windows itself so there is no real way to look them up short of googling I'm afraid.
Same console output but I'm getting failed: (126). I've tried the solutions here but no joy. Any idea what 126 is?
I'm building the C_API\Examples\Hello World project. It seems to build ok but I get the LoadLibrary error in the simulator.
Not sure if it's related but I'm building on Windows 11 via Parallels on an M1 Macbook Pro.
I believe 126 is file not found. When building the example project, inside the Hello World.pdx folder there needs to be the pdex.dll file which is what it's looking for. One question, did you install the Simulator and SDK on the C drive? There are currently path bugs which prevent it from fully working outside the C drive which will be fixed in 1.10.
Yes. Inside the hello_world.pdx folder there's pdex.bin, pdex.dll, and pdxinfo.
I have the SDK in C:\Playdate\PlaydateSDK and I'm building the samples where they are originally.
I've tried both the "x64 Native Tools Command Prompt for VS 2019" with nmake method and also the Visual studio method.
Both build fine and seem to output the correct files but both give the 126 error in the simulator.
Are you running as an admin user? The other possibility is a permissions issue loading the dll. Error 126 is a bit generic so it's hard to figure out what exactly is going on.
When I run the simulator as administrator it no longer lets me drag a pdx onto it (does nothing), but when I open with File->Open it gives the same error 126. I tried it with the Particles sample too.
No, that didn't make any difference.
In the README.md file you'll find a link to the C++ redistributable runtime, try installing that and see if that helps.
I do have Visual Studio Community 2022 installed. I tried installing Visual Studio Community 2019 alongside and built with that also. Same result, it builds ok but didn't run in the sim.
I removed the newer redist and replaced it with that one but no difference. I did notice that there's an ARM version of the redist installed also. I'm thinking it must be related to running through Parallels on an M1 Mac (as many other people don't have these issues).
Not sure if it would help, but you need the X64 version, not the x86 32 bit version you're trying to install here. The Simulator is 64 bit only. Also, there could be some weird interplay between the M1 VM and Windows, but I haven't heard of anything specific.
Yeah I have the x64 installed.
Oh well, I guess it's back to mac and start becoming more familiar with XCode