我编译百度语音Demo(linux c)出现如下所示错误,如何修正?
招谁惹谁之提问 发布于2016-04 浏览:2644 回复:3
0
收藏

g++ -I./  -Wall -DFUNCTION_TEST -g -c sample.cpp -o sample.o
sample.cpp: In function ‘int main(int, char**)’:
sample.cpp:57:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sample.cpp:58:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sample.cpp:59:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sample.cpp:69:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sample.cpp:70:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
gcc sample.o base64.o -lpthread -lm -lstdc++ ./json-cpp/lib/libjson.a ./curl/lib/libcurl.a  -o test
./curl/lib/libcurl.a(libcurl_la-timeval.o): In function `curlx_tvnow':
timeval.c:(.text+0xf): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [test] Error 1

收藏
点赞
0
个赞
共3条回复 最后由用户已被禁言回复于2022-04
#3fujiayi1984回复于2017-09

招谁惹谁之提问:

It's solved! Add "-lrt" at the end of  "LIBS=-lpthread -lm -lstdc++ ./json-cpp/lib/libjson.a ./curl/lib/libcurl.a"

回复招谁惹谁之提问:感谢您的分享

0
#4fujiayi1984回复于2017-09

招谁惹谁之提问:

It's solved! Add "-lrt" at the end of  "LIBS=-lpthread -lm -lstdc++ ./json-cpp/lib/libjson.a ./curl/lib/libcurl.a"

回复招谁惹谁之提问:感谢您的分享

0
#2招谁惹谁之提问回复于2016-04

It's solved! Add "-lrt" at the end of  "LIBS=-lpthread -lm -lstdc++ ./json-cpp/lib/libjson.a ./curl/lib/libcurl.a"

0
TOP
切换版块