[Tutorial] Cross compile SDL2 C(++) applications from Linux to clockworkOS

I will dig into those, but I’m fairly sure its something with the host system. But I will work through those and see if theres anything in there I can use to get it fixed. also on the front of the live qemu version. i have a kernel that works, (not the one they compiled) but its not liking the image at all lol. might take some tinkering but I will have it soon so native development environment may be soon

I’d be interested in seeing how to cross compile SDL-image as well. Will be giving it a try in the next few days and report back. Thanks for the tutorial!

2 Likes

ok, I am now VERY confident that using the actual image will not work in a qemu due to the specific way things like the devices were setup for the clockwork. [there’s always the truth that i’m likely wrong] but I am returning to an armhf version of debian which can run the code. I am going to finish it up and get the libraries sync’d up with what I find in the clockwork. also elsewhere on the forum is a setup to use the apt repos and I will be working on getting things packaged up and utilize that for the libraries/etc. and if i’m not too overly enthusiastic I will try to get a front end for package management to simplify things greatly. this will lead for a fork of the image but I’m confident we can get things stable and maybe even better than the existing setup.

1 Like

I’ve seen that topic too, I’m not too excited about forking the official image to be honest, I’d rather work with the clockworkOS team on contributions to the existing launcher if we want to change things.

I don’t care much about customising the launcher, that’s the main reason why I’ve stayed out of that topic, but I’d be great if we can set up discussion room on the Discord server to evaluate our options.

1 Like

my goal isnt to take anything away from them or to simply replace the launcher. I’m thinking of the entire OS. simplify software deployment and updates by utilizing a mechanism thats already built into the system. I’m thinking of things like additional libraries when required or updates to things like libretro/etc. and I would LOVE if the existing dev’s were to get involved. when it comes to the launcher, I’ve replaced almost all the graphics and i’m putting together a sort of theme changer that uses python. but any updates they make overwrite everything i’ve done every update. which gets a little annoying hence my branch into that. also can you please send me a list of the packages installed in your development image. i think the issue I’m having is because the host does not have the right GL libraries at compile time. if you need a quick command to pull the list you can use (ASSUMING DEBIAN VARIANT) “apt list --installed | grep opengl | less”

1 Like
$ apt list --installed | grep opengl
$ libopengl0/bionic-updates,now 1.0.0-2ubuntu2.2 amd64 [installed,automatic]

well that doesnt help lol. can you try the same for mesa please? i have the same opengl lib installed. what about maybe sending me your binary file so i can test it on my machine (open gl support installed)

Sorry for the silence, I was on a work trip and had barely any energy left to check mail or social media after work during the whole week.

Coincidentally, I managed to reproduce your error (I think?) and I couldn’t get my own OpenGL (SDL2) applications to launch on GameShell today. I realised that it was because the driver was set to Lima instead of Fbturbo (which I did recently because I used the GameShell at the airport quite a lot).

I added instructions and a note about this to the GitHub repository, I don’t think I’ve ever had this working with Lima.

I also uploaded my binary to the GitHub repository as well, might help if the driver thing wasn’t the issue for you, good luck!

1 Like

i will DEFINITELY try that. I have been away myself. I am on vacation until the 8th but once back I will be digging deeply into getting either the official image to boot in qemu or the debian variant with it overlaid done. I have also started planning on getting things ready to make a proper repo for this CPI and will be working on a different image that can utilize it. I messaged yong about it, waiting to hear back about the possibility of official support for it.

to follow up. my GPU Driver switch is set to Fbturbo. and even when i switched to Lima it failed. sorry for the long time in my response, i was on vacation. I have restarted work on a VM version of the GS build and will report progress soon. I’m currently doing excessive research into the special format used by the sun packer tools as i feel it might give some insight on getting this to boot outside the physical CPI.

@yong is there any chance you can post or provide the .config for the kernel on the GIT or forum. PS: if this is all open source why arent the kernel/etc already available [i do accept that it may be because I’m blind and havent found it]

I tried the crosscompile way. But I found also the CPU of the CPI to be quite powerful so I do the code compilation there directly.
So there are no issues with missing libraries or wrong versions. Visual Studio now even supports remote cmake targets and can debug them. What else can we wish for?

1 Like

I’ve found building on the Gameshell to work well too. The only exception might be insanely large projects like the latest MAME code. @guu did a build of that late last year and I think it took over 24 hours to complete! I’ve had a few things take 15 minutes or more, but I’ll just let it “cook” in the background and go off and do something else. (and hope for no errors or build issues). :wink: