未定义的参考clock_gettime

时间:2012-10-24 13:26:38

标签: clock

我不知道如何获得clock_gettime()。 我使用了-irt选项。但我得到错误。 其他问题? 请帮帮我。

root@c405:/home/c405/workspace/rpy/Beremiz_120730/EtherLAB/tool# make
/bin/sh ../libtool --tag=CXX   --mode=link g++ -I../include -I../master -Wall -DREV=`if test -s ../revision; then cat ../revision; else hg id -i .. 2>/dev/null || echo "unknown"; fi` -fno-strict-aliasing -g -O2    -o ethercat soe_errors.o ethercat-Command.o ethercat-CommandAlias.o ethercat-CommandCStruct.o ethercat-CommandConfig.o ethercat-CommandData.o ethercat-CommandDebug.o ethercat-CommandDomains.o ethercat-CommandDownload.o ethercat-CommandFoeRead.o ethercat-CommandFoeWrite.o ethercat-CommandGraph.o ethercat-CommandMaster.o ethercat-CommandPdos.o ethercat-CommandRegRead.o ethercat-CommandRegWrite.o ethercat-CommandRescan.o ethercat-CommandSdos.o ethercat-CommandSiiRead.o ethercat-CommandSiiWrite.o ethercat-CommandSlaves.o ethercat-CommandSoeRead.o ethercat-CommandSoeWrite.o ethercat-CommandStates.o ethercat-CommandUpload.o ethercat-CommandVersion.o ethercat-CommandXml.o ethercat-DataTypeHandler.o ethercat-FoeCommand.o ethercat-MasterDevice.o ethercat-NumberListParser.o ethercat-SdoCommand.o ethercat-SoeCommand.o ethercat-main.o ethercat-sii_crc.o ethercat-CommandEoe.o  -irt 
libtool: link: g++ -I../include -I../master -Wall -DREV=unknown -fno-strict-aliasing -g -O2 -o ethercat soe_errors.o ethercat-Command.o ethercat-CommandAlias.o ethercat-CommandCStruct.o ethercat-CommandConfig.o ethercat-CommandData.o ethercat-CommandDebug.o ethercat-CommandDomains.o ethercat-CommandDownload.o ethercat-CommandFoeRead.o ethercat-CommandFoeWrite.o ethercat-CommandGraph.o ethercat-CommandMaster.o ethercat-CommandPdos.o ethercat-CommandRegRead.o ethercat-CommandRegWrite.o ethercat-CommandRescan.o ethercat-CommandSdos.o ethercat-CommandSiiRead.o ethercat-CommandSiiWrite.o ethercat-CommandSlaves.o ethercat-CommandSoeRead.o ethercat-CommandSoeWrite.o ethercat-CommandStates.o ethercat-CommandUpload.o ethercat-CommandVersion.o ethercat-CommandXml.o ethercat-DataTypeHandler.o ethercat-FoeCommand.o ethercat-MasterDevice.o ethercat-NumberListParser.o ethercat-SdoCommand.o ethercat-SoeCommand.o ethercat-main.o ethercat-sii_crc.o ethercat-CommandEoe.o -irt 
ethercat-CommandSlaves.o: In function `CommandSlaves::listSlaves(MasterDevice&, std::list<ec_ioctl_slave_t, std::allocator<ec_ioctl_slave_t> > const&, bool)':
/home/c405/workspace/rpy/Beremiz_120730/EtherLAB/tool/CommandSlaves.cpp:176: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [ethercat] 오류 1
root@c405:/home/c405/workspace/rpy/Beremiz_120730/EtherLAB/tool# 

1 个答案:

答案 0 :(得分:2)

使用-lrt代替-irt。拼写错误?