这个问题与以下问题高度相关找不到-lm,但是当我调用跨 G++ 链接器时出现错误。
我正在尝试遵循以下提供的文档将 Eclipse 与 ARTIK SDK 结合使用。在执行“创建 SDK 项目 - Linux”部分时,我遇到了以下错误:
18:02:24 **** Incremental Build of configuration Default for project gpio-test ****
make all
Building target: gpio-test
Invoking: Cross G++ Linker
arm-linux-gnueabihf-g++ -L"/opt/sysroots/artik-sysroot/usr/lib" --sysroot=/opt/sysroots/artik-sysroot -o "gpio-test" ./artik_gpio_test.o -lartik-sdk-base
/opt/toolchains/gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.4.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
make: *** [gpio-test] Error 1
18:02:24 Build Finished (took 63ms)
调用交叉 G++ 链接器时出现问题。如果我将代码传输到 ARTIK,则会收到以下错误:
Last login: Thu Apr 13 21:10:38 2017 from 192.168.0.11
/root/gpio-test/artik_gpio_test.c;exit
[root@artik ~]# /root/gpio-test/artik_gpio_test.c;exit
/root/gpio-test/artik_gpio_test.c: line 10: enum: command not found
/root/gpio-test/artik_gpio_test.c: line 11: R: command not found
/root/gpio-test/artik_gpio_test.c: line 12: G: command not found
/root/gpio-test/artik_gpio_test.c: line 13: B: command not found
/root/gpio-test/artik_gpio_test.c: line 14: syntax error near unexpected token `}'
/root/gpio-test/artik_gpio_test.c: line 14: `};'
logout
我能做些什么?