gpt4 book ai didi

linux - linux安装opencv报错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:13:15 25 4
gpt4 key购买 nike

我正在尝试在 linux 平台上安装 Opencv。基本上,我关注 http://sysads.co.uk/2014/05/install-opencv-2-4-9-ubuntu-14-04-13-10/ .

但是每当我尝试构建示例时,我都会收到以下错误-

compiling contours.c
/usr/bin/ld: cannot find -lcufft
/usr/bin/ld: cannot find -lnpps
/usr/bin/ld: cannot find -lnppi
/usr/bin/ld: cannot find -lnppc

但是,我在/usr/local/cuda-7.5/中有所有这些文件。我已经正确安装了 CUDA。 lspci -v -s $(lspci | grep VGA | cut -d""-f 1)

的输出
01:00.0 VGA compatible controller: NVIDIA Corporation GK107GL [Quadro K600] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Hewlett-Packard Company Device 094b
Physical Slot: 2
Flags: bus master, fast devsel, latency 0, IRQ 30
Memory at ee000000 (32-bit, non-prefetchable) [size=16M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
Memory at e0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
[virtual] Expansion ROM at ef000000 [disabled] [size=512K]
Capabilities: <access denied>
Kernel driver in use: nvidia

请帮忙。

最佳答案

我已经通过编辑 build_all.sh 解决了这个问题,它可以在 /usr/local/share/OpenCV/samples/c 目录中找到。新的 build_all.sh 是:

#!/bin/sh

if [ $# -gt 0 ] ; then
base=`basename $1 .c`
echo "compiling $base"
gcc -ggdb -L /usr/local/cuda-7.5/lib64 `pkg-config opencv --cflags --libs` $base.c -o $base
else
for i in *.c; do
echo "compiling $i"
gcc -ggdb -L /usr/local/cuda-7.5/lib64 `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`;
done
for i in *.cpp; do
echo "compiling $i"
g++ -ggdb -L /usr/local/cuda-7.5/lib64 `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`;
done
fi

关于linux - linux安装opencv报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33998387/

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