SFML community forums

Bindings - other languages => C => Topic started by: student123 on September 22, 2021, 04:11:32 pm

Title: csfml on m1
Post by: student123 on September 22, 2021, 04:11:32 pm
I am trying to understand csfml and I am trying to execute the following code:

#include <stdio.h>
#include <SFML/Window.h>
#include <SFML/Graphics.h>
int main() {
    sfVideoMode mode = {1080, 720, 32};
    sfRenderWindow *window;
    sfEvent event;
    window = sfRenderWindow_create(mode, "csfml lib", sfResize | sfClose, NULL);
    return 0;
}

This breaks down on the line with Render, everything works without it.

I get this error:

Undefined symbols for architecture arm64:
  "_sfRenderWindow_create", referenced from:
      _main in main.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [engine] Error 1
make[2]: *** [CMakeFiles/engine.dir/all] Error 2
make[1]: *** [CMakeFiles/engine.dir/rule] Error 2
make: *** [engine] Error 2


I couldn't find any information on whether csfml is compatible with my processor or something I'm doing wrong, so I need help.
Title: Re: csfml on m1
Post by: eXpl0it3r on September 27, 2021, 08:47:04 am
The package on the SFML website under bindings clearly states that it's for 64-bits, as such it won't work on ARM64. You'd probably have to build SFML and CSFML from scratch.