Mraa examples problem in Rock PI S

Hi.
I’m trying to use the included C examples for the different hardware features of the ROCK PI S.

When I try to compile them, I realize that the compiler does not find multiple functions of the mraa library.For example, when I compile gpio.c, I get this:

*rock@rockpis:~/controller$ gcc gpio.c -o gp
/tmp/cceUb7kR.o: In function main': gpio.c:(.text+0x74): undefined reference to mraa_init’
gpio.c:(.text+0x7c): undefined reference to mraa_gpio_init' gpio.c:(.text+0xb4): undefined reference to mraa_deinit’
gpio.c:(.text+0xc4): undefined reference to mraa_gpio_init' gpio.c:(.text+0xfc): undefined reference to mraa_deinit’
gpio.c:(.text+0x110): undefined reference to mraa_gpio_dir' gpio.c:(.text+0x12c): undefined reference to mraa_gpio_dir’
gpio.c:(.text+0x14c): undefined reference to mraa_gpio_write' gpio.c:(.text+0x168): undefined reference to mraa_gpio_write’
gpio.c:(.text+0x18c): undefined reference to mraa_gpio_write' gpio.c:(.text+0x1a8): undefined reference to mraa_gpio_write’
gpio.c:(.text+0x1dc): undefined reference to mraa_gpio_close' gpio.c:(.text+0x1f4): undefined reference to mraa_gpio_close’
gpio.c:(.text+0x208): undefined reference to mraa_deinit' gpio.c:(.text+0x254): undefined reference to mraa_result_print’
gpio.c:(.text+0x258): undefined reference to `mraa_deinit’
collect2: error: ld returned 1 exit status
rock@rockpis:~/controller$
*
I apologize for my lack of knowledge, but I am really new to these devices.

Thanks a lot

Gonzalo

Sorry, it’s a little late
You try:
gcc gpio.c -o gp -lmraa

Thanks a lot for your answer.
It works!!
Lets Rock!

You can go to rockpis home page https://wiki.radxa.com/RockpiS , learn more about the function development of rockpis