Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: csfml on m1  (Read 8904 times)

0 Members and 1 Guest are viewing this topic.

student123

  • Newbie
  • *
  • Posts: 1
    • View Profile
csfml on m1
« 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11008
    • View Profile
    • development blog
    • Email
Re: csfml on m1
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/