c - /usr/bin/x86_64-linux-gnu-ld: cannot find?
问题描述
I study C language in ubuntu 18.04(gcc 7.3)
When the make all
command is entered, this error occurrs:
/usr/bin/x86_64-linux-gnu-ld: can not find -lkeccak
The Makefile
is as follows.
CC=gcc
CFLAGS=-03 -fomit-frame-pointer -msse2avx -mavx2 -march=native -std=c99
all:
$(CC) $(CFLAGS) -c Lizard.c main.c randombytes.c sha512.c
$(CC) $(CFLAGS) -o Lizard Lizard.o main.o randobytes.o sha512.o -lkeccak
run: all
./Lizard
new:
make clean
make all
./Lizard
Currently the libkeccak.a
file is in the same directory as the Makefile
and
it is also in the /usr/include
directory.
I do not know the solution method at all.
Please, Help me.
解决方案
该-l
选项用于链接动态库(如libkeccak.so
)。如果静态库位于“标准”目录之一中,则它们已经链接到可执行文件中,因此无需提供 option -lkeccak
。
如果你想明确告诉 GCC 链接一个静态库,
gcc -l:/path/to/libkeccak.a
推荐阅读
- sql - R SQL查询:找不到存储过程
- python - 如何将时间转换为字符串并在 Python df 中保持 NaT 不变?
- macos - 系统扩展验证失败
- javascript - javascript 返回 false 或 preventDefault 不起作用
- swiftui - SwiftUI 和自定义框架
- javascript - 如何使用数据表和服务器端数据源修复分页错误?
- swift - IOBluetooth 的问题
- javascript - 找不到插件“eslint-plugin-promise”
- python - 如何根据熊猫数据框中的行和列分隔条目
- python-3.x - 根据熊猫数据框中的某些条件过滤行