当前位置: 技术问答>linux和unix
cygwin运行中出错
来源: 互联网 发布时间:2016-08-05
本文导语: $ gcc judge.c /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xa4f): un defined reference to `_PQexec' /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbb7): un defined reference to `_PQconnectdb' /cygdrive/c/DOCUME~1/ADMINI~1/LO...
$ gcc judge.c
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xa4f): un
defined reference to `_PQexec'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbb7): un
defined reference to `_PQconnectdb'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbc9): un
defined reference to `_PQstatus'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbfc): un
defined reference to `_PQerrorMessage'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc39): un
defined reference to `_PQstatus'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc4a): un
defined reference to `_PQreset'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc57): un
defined reference to `_PQstatus'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc8a): un
defined reference to `_PQerrorMessage'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xd64): un
defined reference to `_PQexec'
出现上面的错误,请遇到过的,解释下是什么错误?该怎么解决?不胜感激
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xa4f): un
defined reference to `_PQexec'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbb7): un
defined reference to `_PQconnectdb'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbc9): un
defined reference to `_PQstatus'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xbfc): un
defined reference to `_PQerrorMessage'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc39): un
defined reference to `_PQstatus'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc4a): un
defined reference to `_PQreset'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc57): un
defined reference to `_PQstatus'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xc8a): un
defined reference to `_PQerrorMessage'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUam0zt.o:judge.c:(.text+0xd64): un
defined reference to `_PQexec'
出现上面的错误,请遇到过的,解释下是什么错误?该怎么解决?不胜感激
|
没有link你需要的库。
gcc judge.c -Lpath -lpq
其中path是你的库所在位置,pq是库的名字。
gcc judge.c -Lpath -lpq
其中path是你的库所在位置,pq是库的名字。
|
实质上还是连接了, 只不过是以默认的方式连接的。
1楼正解,你看看自己连接库的位置是否正确。