2012-10-24 138 views
0

我不知道如何獲得clock_gettime()。 我使用-irt選項。但我得到錯誤。 其他問題? 請幫幫我。未定義的參考clock_gettime

[email protected]:/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 
[email protected]:/home/c405/workspace/rpy/Beremiz_120730/EtherLAB/tool# 

回答

2

使用-lrt而不是-irt。拼寫錯誤?