ebenoist / libblinkstick

A blinkstick library in C
MIT License
11 stars 9 forks source link

ld: symbol(s) not found for architecture arm64 linker command failed #44

Open andreschoque3 opened 1 year ago

andreschoque3 commented 1 year ago
#include <stdio.h>
#include <libblinkstick.h>

int main() {
       blinkstick_device* device = blinkstick_find();
       if (device == NULL) {
           printf("Failed to open BlinkStick device\n");
           return 1;
       }

       blinkstick_set_color(device, 255, 0, 0, 0, 0); // Set color to red

       blinkstick_destroy(device);
       return 0;
   }

I am trying to run this sample code but when I tried to compile it using gcc I go the following errors:

Undefined symbols for architecture arm64:
  "_blinkstick_destroy", referenced from:
      _main in blink-f7ff16.o
  "_blinkstick_find", referenced from:
      _main in blink-f7ff16.o
  "_blinkstick_set_color", referenced from:
      _main in blink-f7ff16.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am thinking that this code is developed for an AMD64 based architecture instead of an ARM64. How can I update the library for an ARM based architecture?

ebenoist commented 1 month ago

Great question. There isn’t any cpu specific code and I believe I’ve ran this on a ARMv7. I’ll check it out on my M3.