No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 armv7s)

本文详细记录了解决ZBarSDK导入过程中遇到的各种错误的方法,包括缺少必要框架、32位与64位兼容性问题等,并提供了解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

当我们导入第三方库的时候,会报一下的一些错误,以下是我再导入扫描二维码ZBarSDK的时候遇到的一些问题:

1.当我导入ZBarSDK编译运行的时候,报以下错误,出现这种情况就是我们没有把必要的框架导进来,我这里是没有把SenTestingKit.framework这个框架导进来,导进来就不会报这个错误了。


这时候我们Framework里面的是这个样子:




2. 导进来之后再次编译,还会报错,报的错是:

3.当我修改之后成为这样,

4.这时候编译运行,还会报错,报的错误是:

5当我修改Framework之后,是这样的:


这时候我们再次编译运行就OK了,不会报错了。

有关32为能运行64位报错的问题:一般如果报


最后我总结了一下,以前我也遇到过,有关32为能运行64位报错的问题, 一般如果报这种错误: No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 armv7s)

我们直接修改Framework成这样就OK了,至少我之前可以了,大家如果遇到了,可以试一下我提供的方案,说不定能帮不到大家。

图片:





cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2 #define CUDNN_MAJOR 8 #define CUDNN_MINOR 9 #define CUDNN_PATCHLEVEL 7 -- #define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL) /* cannot use constexpr here since this is a C-only file */ (base) whyerwang@whyerwang-Lenovo-ThinkBook-16p-Gen-5:~/cudnn_samples_v8/mnistCUDNN$ cp -r /usr/src/cudnn_samples_v8/ $HOME cd ~/cudnn_samples_v8/mnistCUDNN make clean && make ./mnistCUDNN # 显示"Test passed!"即成功[^2] rm -rf *o rm -rf mnistCUDNN CUDA_VERSION is 12090 Linking agains cublasLt = true CUDA VERSION: 12090 TARGET ARCH: x86_64 HOST_ARCH: x86_64 TARGET OS: linux SMS: 50 53 60 61 62 70 72 75 80 86 87 90 nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). test.c:1:10: fatal error: FreeImage.h: 没有那个文件或目录 1 | #include "FreeImage.h" | ^~~~~~~~~~~~~ compilation terminated. >>> WARNING - FreeImage is not set up correctly. Please ensure FreeImage is set up correctly. <<< [@] /usr/local/cuda/bin/nvcc -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -ccbin g++ -m64 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90,code=compute_90 -o fp16_dev.o -c fp16_dev.cu [@] g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp [@] g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -o mnistCUDNN.o -c mnistCUDNN.cpp [@] /usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90,code=compute_90 -o mnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -lcublasLt -LFreeImage/lib/linux/x86_64 -LFreeImage/lib/linux -lcudart -lcublas -lcudnn -lfreeimage -lstdc++ -lm bash: ./mnistCUDNN: 没有那个文件或目录
最新发布
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值