当我通过putty编译c程序时出错

时间:2015-03-05 05:09:20

标签: c linux

/tmp/ccfg3L9u.o: In function `main':
Allgo-API-Test.c:(.text+0x968): undefined reference to `mport_get_sub_metadata_entries'
Allgo-API-Test.c:(.text+0xb24): undefined reference to `mport_set_play_scope'
collect2: error: ld returned 1 exit status
Makefile:86: recipe for target 'bin/MediaPort.elf' failed
make: *** [bin/MediaPort.elf] Error 1

1 个答案:

答案 0 :(得分:1)

我认为您在编译文件时强调要链接其他库 Allgo-API-Test.c

在编译此文件之前,您应该拥有包含mport_get_sub_metadata_entriesmport_set_play_scope定义的库。获得该库后,您可以使用以下命令进行编译。

g++ Allgo-API-Test.c -l(your library) [-L(path to your library)]