如何让自己configure找到需要的库?

Linux下编译C/C++项目指定头文件和链接库搜索路径 头文件路径 方式1:#include <...> 方式2:#include "..." <说明> #include <...> 和 #include "..." 的区别: 1. 前者一般会优先搜索 -I 选项后的头文件路径(即用gcc编译时的-I选项),之后就是标准的系统头文件路径。 2. 后者是从当前的目录来搜索 #示例,会优先从/home/xi... 阅读详情

今天编译一个开源库libartnet的使用demo时候遇到一个问题,之前没遇到过的,记录一下。

其实很简单,这个开源库编译安装时,我习惯性地不把它安装到/usr或者/usr/local下,而是安装到/opt下,只是为了以后不想要的时候删掉比较方便,结果编译artnet的demo的时候就编译不了了,因为这个demo程序也是通过configure make 这样的步骤去编译的。具体问题就是在执行configure脚本的时候找不到自己安装在/opt下的库,因为默认不会去那里找库的。

那怎么办呢?

如果是makefile或者gcc编译命令还好改,直接加搜索路径就可以了,仔细一看,原来这个检查项目依赖的动态链接库的步骤是通过pkg-config工具去完成的,pkg-config工具是去读所有.pc文件的。这些pc文件在哪里找呢?默认会在/usr/lib/、/lib/类似的这些放置比较重要的库的目录下的pkgconfig目录里,如果自己安装了一个库在这些目录里的话,对应库的pc文件也会放到这些目录的pkgconfig目录下,所以可以默认搜索得到。但是自己装得库就不会,你安装在哪里,库的pc文件就在对应pkgconfig目录里,而这pkg-config工具是不知道的。所以我们只需要为PKG_CONFIG_PATH这个环境变量添加自己的库的pc文件存放路径比如/opt/artnet/lib/pkgconfig/,这样在configure的时候就会去搜索这个目录下的动态链接库了。

提醒一下:PKG_CONFIG_PATH和PATH变量一样,通过冒号间隔前后两个搜索的路径。

pkg-config也是一个有意思的东西啊!

编译源码pkg-config报错问题(configure\pkg-config\PKG_CONFIG_PATH关系) 编译源码pkg-config报错问题: … d libraries… yes checking dynamic linker characteristics… (cached) GNU/Linux ld.so checking how to hardcode library paths into programs… immediate checking for pkg-config… /usr/bin/pkg-config checking pkg-config is at least version 0. 阅读详情

相关推荐

configure指定编译头文件和库文件路径

**使用CPPFLAGS**:`CPPFLAGS`是C/C++预处理器的标志,通过加上`-I`可以指定包含头文件的目录。- **使用`./configure`参数**:某些`configure`脚本允许使用`--with-XXX`参数直接指定依赖库的路径。- **使用pkg-config**:对于使用`pkg-config`管理的库,可以通过`.pc`文件来定位头文件和库文件。`pkg-config`工具能够根据这些`.pc`文件生成需要的编译和链接参数。

数字人生 5921

configure 的依赖库搜索目录

转载:http://blog.sina.com.cn/s/blog_6e32babb0101l674.html 如果有某个依赖库XXX的版本不合,往往需要自己安装一个新的版本, 这时候往往可以用 ./configure --with-XXX=/path1/path2/.. 这样的方式把新安装的库指定进去。 但是有的时候,./configure --help 会发现,并没有对XXX...

huihuiwith的博客 9057

libartnet-win32 artnet dmx library:通过以太网网络发送和接收artnet / art-net,而不是DMX-开源

libartnet是用于通过网络传输Artnet数据的库。 Artnet数据用于1)接收由雷电控制台或DMX软件发送的DMX值2)发送DMX数据... x)传输固件及更多信息...用于Artnet2MIDI,uDMXArtnet和最可能的更多应用程序中。 libartnet-win32基于仅适用于* nix系统的libartnet的早期版本。 libartnet的实际版本:http://code.google.com/p/linux-lighting/downloads/detail?name=libartnet-1.1.0.tar.gz

configure 查找依赖库_configure 查找依赖库_动态库查找路径及LD_LIBRARY_PATH问题

说到和动态库查找路径相关的问题,总体上可以分为两类:第一类:通过源代码编译程序时出现的找不到某个依赖包的问题第二类:就是在运行程序的时候,明明把那个程序需要的依赖包都已经安装的妥妥的了,可运行的时候人家就告诉你说error while loading shared libraries: libxxx.so.y: cannot open shared object file: No such fil...

weixin_31321851的博客 1637

SAP产品合规(Product Compliance)管理—规格主数据 CG02/CG02WB

SAP产品合规(Product Compliance)管理—规格主数据概览 CG02/CG02WB

Lucas1211的博客 1430

Unity AssetBundle解包实战指南:从工具使用到编程解析

在游戏开发与资源管理中,资源打包与加载是核心技术环节。AssetBundle作为Unity引擎官方推荐的资源分发方案,其本质是一个包含头部信息、目录表、数据区及依赖关系的结构化文件系统,通过序列化机制将游戏资源转换为二进制格式。理解AssetBundle的机制对于实现高效的热更新、减少资源冗余、优化加载性能具有重要价值,广泛应用于游戏开发、竞品分析、技术研究等场景。本文聚焦AssetBundle解包这一实践需求,系统介绍如何利用AssetStudio、UABE等主流工具进行资源提取与可视化分析,并深入探讨通

weixin_28192383的博客 347

configure小记

1. 指定头文件路径 ./configure --includedir=/home/work/inclue 2.指定输出路径 ./configure --prefix=/usr 3. PKG_CONFIG_PATH export PKG_CONFIG_PATH=/home/mike/usr/lib/pkgconfig

在线笔记 1042

FreeRTOS项目:智能手表(1);

从 “最底层启动”→“系统基础配置”→“硬件驱动”→“中间件能力封装”→“上层业务功能”,分层递进、从基础到应用,就能逐步把整个项目的逻辑串联起来~

weixin_46847454的博客 1447

configure 配置 extundelete-0.2.0的时候发现提示 没有找到 ext2fs 库的解决办法

问题: 在ubuntu上安装之前,./configure 配置 extundelete-0.2.0的时候发现提示 没有找到 ext2fs 库   extundelete-0.2.0$ ./configure Configuring extundelete 0.2.0 configure: error: Can't find ext2fs library    解决办法:

duanlove(技术路途)专栏 1万+

SDU CS 期末考回忆版合集

删除原有分散的版本,合订起来画个。包括:机器学习、算法、图形学、操作系统、编译原理、软件工程、大数据分析管理、计算机体系结构等。

https://github.com/ZhaoyungZhang 6649

【WorkBuddy专栏68】HY3绕路部署vsDS4直击根因——一次真实踩坑揭露两个AI模型的推理差距

【WorkBuddy专栏68】HY3绕路部署vsDS4直击根因——一次真实踩坑揭露两个AI模型的推理差距

AI人人懂 560

configure 配置extundelete-0.2.4的时候发现提示 没有找到 ext2fs 库的解决办法

问题: 在ubuntu中,./configure 配置 extundelete-0.2.4的时候发现提示configure: error: Can't find ext2fs library,如下所示: 解决办法: 安装e2fs的库: sudo apt-get install e2fslibs-dev e2fslibs-dev 运行如下: ...

mlove编程 5054

【算能】TPU(张量处理单元)的深度解析

算能(SOPHGO)作为国产AI芯片领域的核心企业,其TPU(张量处理单元)以高能效比与全场景覆盖能力为核心竞争力,专注于边缘计算与行业垂直领域的AI推理加速。

浩瀚之水的专栏 1548

程序编译中怎么样调试configure

程序编译中怎么样调试configure 来源:IBM DW中国 作者:Peter Seebach  时间:2007-04-22 点击:[收藏] [投稿] <!--google_ad_client = "pub-549909949982894

sdlcgxcqx的专栏 696

【100%通过率】华为od机试C卷【出差 / 员工派遣】C++ 实现

某公司部门需要派遣员工去国外做项目。现在,代号为 x 的国家和代号为 y 的国家分别需要 cntx 名和 cnty 名员工部门每个员工有一个员工号 (1,2,3,......),工号连续,从 1开始。部长派遣员工的规则:

MISAYAONE的博客 2194

RK3588 部署 YOLO26 目标检测:从训练到 NPU 推理

如果做垂直场景(工业缺陷、农作物、特定零件),需要自己标数据。采集图像(500+ 张,覆盖不同光照/角度)→ 筛选(删除模糊/无目标)→ LabelImg 标注(选择 YOLO 格式)→ 划分(train:val:test = 7:2:1)labelImg├── train/├── val/├── test/YOLO26 在 RK3588 上的全流程是 PC 端训练 + ONNX 导出 → RKNN 转换(INT8 量化)→ 板端推理。

m0_71589036的博客 110

configure:error no SDL library found

configure:error no SDL library found安装SDL库 未找到SDL库,需要安装SDL库 安装SDL库 搜索的所有可用实例libsld1.2: apt-cache search ^libsdl | grep 1.2 使用以下内容安装所有结果文件 sudo apt-get install libsdl1.2debian libsdl-gfx1.2-5 libsdl-gfx1.2-dev libsdl-gfx1.2-doc libsdl-image1.2 libsdl-image1

ff_hh的博客 486

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

安装postgreSQL出现configure: error: zlib library not found解决方法

安装postgreSQL出现configure: error: zlib library not found解决方法

Littleree的博客 695

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

交叉编译libIDL库

<br /><br />哈哈,欢迎访问,希望可以帮到你,。。祝您的母亲快乐健康。<br /><br /><br />安装libIDL库出现错误如下:<br /><br /><br />checking for format to printf and scanf a guint64... configure: error: cannot run test program while cross compiling。<br /><br /><br /><br /><br />解决方法:<br /><br /

fangcaixia498602700的专栏 1218

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

centos7环境下编译安装gdal库

1. 下载gdal源码: http://trac.osgeo.org/gdal/wiki/DownloadSource 下载指定版本的gdal源码压缩包到当前位置: wget http://download.osgeo.org/gdal/2.2.4/gdal-2.2.4.tar.gz 解压gdal文件夹到当前路径下 tar xvf gdal-2.2.4.tar.gz 进入gdal文件夹 cd gdal-2.2.4 安装编译需要的库 sudo yum install .

CallmeAdo的专栏 6392

configure: error: Can not link to python

在ubuntu下编译mod_python时出了个问题,configure: error: Can not link to python ,checking checking where python libraries are installed... /usr/lib/python2.5checking for Py_NewInterpreter in -lpython2.5... no

子剑灵学技术 2674

configure: error: MySQL library not found

在CentOS系统中,安装zabbix进行configure时会遇到以下问题 ./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-jabber --with-libcurl configure: error: MySQL library not found the problem is ...

weixin_30599769的博客 282

寻找大佬帮忙,这个错误从未碰到过,Linux下运行./configure

寻找大佬帮忙,这个错误从未碰到过,Linux下运行./configure checking for a BSD-compatible install… /bin/install -c checking whether build environment is sane… yes checking for gawk… gawk checking whether make sets $(MAKE)… ...

weixin_43392288的博客 1452

【Nginx】configure 报错checking for C compiler … not found

编译安装在执行./configure步骤报错,是因为缺少环境变量 checking for C compiler … not found ./configure: error: C compiler cc is not found 解决办法,安装环境需要 yum install gcc gcc-c++ -y 看到这里稍等,如果没有安装openssl openssl-devel 也会编译失败 报错如下 ./configure: error: the HTTP rewrite module

zclinux的博客 7484

configure: error: OpenSSL Crypto library not found

1.解决configure: error: OpenSSL Crypto library not found crypto是什么呢? 是OpenSSL 加密库(lib), 这个库需要openssl-devel包 ,在ubuntu中就是 libssl-dev RedHat Fedora 平台 yum -y install openssl-devel Debian ,ubunu 平台 apt...

小诸葛的博客 5812

PostgreSQL configure: error: readline library not found

前言 安装 PostgreSQL 时报错,以下 configure: error: readline library not found If you have readline already installed, see config.log for details on the failure. It is possible the compiler isn't looking in t...

牛奔的博客 2602
上一篇: linux gcc 把静态链接库.a链接到动态链接库.so里
下一篇: 读《How quitting...》有感
sunnyleevip
博客等级 码龄15年 7粉丝 8原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值