gpt4 book ai didi

c - Ubuntu 11 上 GCC 的链接问题

转载 作者:太空宇宙 更新时间:2023-11-04 00:40:39 26 4
gpt4 key购买 nike

我正在从 Ubuntu 10.04 迁移到 Ubuntu 11.10 (oneiric),但是当我尝试编译一些在 Ubuntu 10.04 上运行良好的应用程序时我遇到了问题,没有任何变化。

我安装了 sqlite3 和 unac 库,与我在 Ubuntu 10.4 上使用的相同。我使用以下命令安装:

sudo su
apt-get install libunac1-dev
apt-get install sqlite3
apt-get install libsqlite3-dev

但是当我运行时:gcc -Wall -lsqlite3 -lunac -Werror -O2 -o ILD.out ILD.c

我收到以下错误:

/tmp/cceRDsMZ.o: In function `removediacritics':
ILD.c:(.text+0x1ae): undefined reference to `unac_string'
/tmp/cceRDsMZ.o: In function `main':
ILD.c:(.text.startup+0x1a): undefined reference to `sqlite3_open'
ILD.c:(.text.startup+0x6c): undefined reference to `sqlite3_prepare_v2'
ILD.c:(.text.startup+0x80): undefined reference to `sqlite3_step'
ILD.c:(.text.startup+0x98): undefined reference to `sqlite3_column_text'
ILD.c:(.text.startup+0xb0): undefined reference to `sqlite3_step'
ILD.c:(.text.startup+0xc1): undefined reference to `sqlite3_finalize'
ILD.c:(.text.startup+0xcd): undefined reference to `sqlite3_close'
ILD.c:(.text.startup+0x10c): undefined reference to `sqlite3_close'
ILD.c:(.text.startup+0x120): undefined reference to `sqlite3_errmsg'
ILD.c:(.text.startup+0x144): undefined reference to `sqlite3_close'
collect2: ld returned 1 exit status

我的 GCC 版本:gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

我不知道如何解决这个问题。

最佳答案

始终在 c 或文件之后传递库选项。

您以前不需要的事实是一个非标准的错误功能。

关于c - Ubuntu 11 上 GCC 的链接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9760815/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com