尝试编译 apue.h 源代码时出错

问题描述 投票:0回答:1

尝试将 apue.h 用于我的 c 代码之一,但我无法编译和制作 apue.h

我首先下载了apue.h source代码

然后我解压了tar.gz文件,进入了apue.3e目录。

接下来我运行了

make
命令,该命令引发了此错误:

gcc -shared -Wl,-dylib -o libapue_db.so.1 -L../lib -lapue -lc db.o
/usr/bin/ld: Error: unable to disambiguate: -dylib (did you mean --dylib ?)
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:32: libapue_db.so.1] Error 1
make[1]: Leaving directory '/home/creative-mode/Downloads/src.3e/apue.3e/db'
make: *** [Makefile:6: all] Error 1

我的

make
版本:

GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
c gcc gnu-make
1个回答
0
投票

我试过了。 你可以删除

-Wl,-dylib
第12行的
db/Makefile
,这似乎是MacOS编译器使用的。

© www.soinside.com 2019 - 2024. All rights reserved.