0

当我运行以下命令时,我目前正在尝试使用共享对象库交叉编译到 mips64:

toby@cbmFinal:~/x-tools/mips64-n64-linux-gnu/bin$ ./mips64-n64-linux-gnu-gcc -I /home/toby/Downloads/net-snmp-5.5.2.1/include/net-snmp/ -L /usr/lib64/libnetsnmp.so ~/BsDiagnostics/snmpdemoapp.c -o snmpdemoapp

它抛出一个错误,说它找不到头文件:

/home/toby/BsDiagnostics/snmpdemoapp.c:1:38: error: net-snmp/net-snmp-config.h: No such file or directory
/home/toby/BsDiagnostics/snmpdemoapp.c:2:40: error: net-snmp/net-snmp-includes.h: No such file or directory
/home/toby/BsDiagnostics/snmpdemoapp.c: In function 'main':
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: 'netsnmp_session' undeclared (first use in this function)
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: (Each undeclared identifier is reported only once
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: for each function it appears in.)
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: expected ';' before 'session'

等等等等

我检查了目录,它们都在那里,我也可以使用 -include 手动完成它们,但是还有一堆我不能全部 -include 的其他标题。

toby@cbmFinal:~/Downloads/net-snmp-5.5.2.1/include/net-snmp$ ls
agent             definitions.h  mib_api.h.gch         output_api.h   session_api.h.gch  utilities.h
config_api.h      library        net-snmp-config.h     pdu_api.h      snmpv3_api.h       varbind_api.h
config_api.h.gch  machine        net-snmp-config.h.in  pdu_api.h.gch  system             varbind_api.h.gch
data_access       mib_api.h      net-snmp-includes.h   session_api.h  types.h            version.h 

任何帮助,将不胜感激。谢谢!

4

1 回答 1

1

已修复,是语法错误。

正确的命令是:

toby@cbmFinal:~/x-tools/mips64-n64-linux-gnu/bin$ ./mips64-n64-linux-gnu-gcc -I/home/toby/Downloads/net-snmp-5.5.2.1/include/ -L/usr/lib64 -lnetsnmp ~/BsDiagnostics/snmpdemoapp.c -o snmpdemoapp
于 2014-09-16T10:15:21.650 回答