Noob here, can't compile the test_advanced sample

I’m teaching myself programming because I want to eventually make my own game. As part of my efforts, I downloaded the test-advanced folder, brought the files into Eclipse, and tried to compile them. Specifically, I brought in libretro.h and libretro-test.c by copying the code into new files, and I generated a new project that was supposed to create a .so file. I must be doing something wrong, because I get this error when I try to build using the makefile from the same Git folder as the two source files:

No rule to make target ‘libretro-test.o’, needed by ‘’.

When I try to build with “generate makefiles automatically” I instead get this error:

./src/libretro-test.o: relocation R_X86_64_PC32 against symbol `pixels’ can not be used when making a shared object; recompile with -fPIC

This may seem obvious to more experienced coders, but how do I get this thing to compile?

1 Like

I think they generally expect to be called from the main top-level makefile. Not sure on that, though. I haven’t messed with them in a very long time.

Edit: Nope. I thought the Skeletor file was being read, but all I got in Retroarch was a controller test. Didn’t figure it out until I tried test_advanced and got the same thing.

Finally stumbled my way into a solution. Going to edit my OP so other noobs don’t need to suffer.

Nevermind. Can’t edit the original post. Gonna edit this one instead.

So, what I did to get a core compiled was first try a different set of source files, in this case Skeletor. Under File->New->New C/C++ project, I chose C Managed Build.

Project name, Skeletor.

Under Project Type, I first tried “shared library”. I’ll save you the trouble. This one doesn’t work. It’s what drove me to look for help in the first place.

Instead you want Static Library. Select your tool chain and click finish.

I didn’t know if copying files directly would work, so instead I created new files with the same names and just copied the contents over. When I selected Project->Build Project, it compiled successfully.

1 Like

lolnope. It makes a .o file.

OMG. Code::Blocks is even worse.

Final update. Got some advice on Reddit to just try running Make in the command line. That actually works. Got all the flashy colors to show up in Retroarch.

Takeaway: Don’t bother with IDEs when developing for Retroarch. They will make you cry. Better off just using your text editor of choice and running Make in the command line.

1 Like