/usr/bin/ld:找不到-lpkgconfig [英] /usr/bin/ld: cannot find -lpkgconfig

查看:93
本文介绍了/usr/bin/ld:找不到-lpkgconfig的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

//============================================================================
// Name        : testlog.cpp
// Author      : rumeel
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <stdio.h>
#include <stdlib.h>
#include <log4cpp/category.hh>
#include <log4cpp/FileAppender.hh>
#include <log4cpp/SimpleLayout.hh>
 
#define LOGFILE "/home/user/test.log"
 
int main()
{
/*Setting up Appender, layout and Category*/
log4cpp::Appender *appender = new log4cpp::FileAppender("FileAppender",LOGFILE);
 
log4cpp::Layout *layout = new log4cpp::SimpleLayout();
log4cpp::Category& category = log4cpp::Category::getInstance("Category");
 
appender->setLayout(layout);
category.setAppender(appender);
category.setPriority(log4cpp::Priority::INFO);
 
category.info("This is for tracing the flow");
category.notice("This is to notify certain events");
category.warn("This is to generate certain warnings");
}



当我尝试运行此项目时,就会发生此错误.因此请帮助我解决此错误



when i try to run this project then this error is occurred.so plz help me to solve this error

/usr/bin/ld: cannot find -lpkgconfig

推荐答案



似乎GCC链接程序无法找到 pkg-config库 [
最好的祝福,
-David Delaune
Hi,

It looks like the GCC linker is unable to find the pkg-config library[^].

Depending on what distro you are using... you should be able to install this package using yum,rpm or maybe apt-get. Or you could optionally download and compile the package and ''make'' it.

Best Wishes,
-David Delaune


您不会那样使用pkg-config.没有可以与您的代码链接的"libpkgconfig".阅读 pkg-config文档 [
You don''t use pkg-config that way. There''s no "libpkgconfig" you could link with your code. Read the pkg-config documentation[^] and fix your Makefile.


这篇关于/usr/bin/ld:找不到-lpkgconfig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆