I'm new to the Intel Edison board and I'm trying to run the m raa library on it. I installed the package using opkg install. I made sure that the package is actually installed by running
opkg list|grep mraa and confirmed that it is actually installed.
However, when I try to run the hellomraa.c program, I get the following linker error.
/tmp/ccehsgj5.o: In function `main':
hellomraa.c:(.text+0x12): undefined reference to `mraa_get_platform_name'
hellomraa.c:(.text+0x1a): undefined reference to `mraa_get_version'
hellomraa.c:(.text+0x38): undefined reference to `mraa_deinit'
collect2: error: ld returned 1 exit status
I'm stuck and not really sure what to do about it.
Thanks in advance,
How are you trying to run it? Are you doing ./hellomraa.c? Because that's not the correct way. You need to run this line in the Edison terminal "g++ -lmraa hellomraa.c -o hellomraa" This way you compile your hellomraa.c file and you a hellomraa object file is created. Now the only thing you need to do is ./hellomraa
Something else, how did you get the hellomraa.c? Did you just flash a new image to your Edison and tried to execute hellomraa.c straight away? You may need the rest of the dependencies
I'm facing the issue when I try to compile the program.
I tried to run gcc -c to make sure that the compiler can actually compile the code and that DOES work.
However, the linker is where I'm facing this issue. My guess is that the linker cannot find the library. But I do not know how to solve the problem.
And I'm not sure what you mean by 'rest of the dependencies'. Are you talking about the mraa library itself?