You are not logged in.
Hello Everyone i just downloaded and installed the c-algorithms package from here https://aur.archlinux.org/packages/c-algorithms/ but i dont rely know how i can use it when compiling with gcc
because when i use for example the <arraylist.h> header file and i compile with
gcc -o main `pkg-config --cflags --libs libcalg1.0` main.c
I get the error message
Package libcalg1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcalg1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcalg1.0' found
main.c:2:22: fatal error: arraylist.h: No such file or directory
#include<arraylist.h>
^
compilation terminated.
Any help on how to compile using this library. Thanks
Last edited by sprinf (2013-05-16 02:39:45)
Offline
Moving to AUR issues.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
it looks like that should be libcalg-1.0 as that is the name of the pc file in the package.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
it looks like that should be libcalg-1.0 as that is the name of the pc file in the package.
When i compile using
gcc -o c `pkg-config --cflags --libs libcalg-1.0` main.c
I still get the error message
Package libcalg-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcalg-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcalg-1.0' found
main.c:2:22: fatal error: arraylist.h: No such file or directory
#include<arraylist.h>
^
compilation terminated.
Offline
Ah, well, the PKGBUILD is 'broken'. I tried installing it, makepkg appropriately gives a warning that there is no package function. I followed through anyways, and as suspected, it didn't install anything. It is an empty package.
Fix the PKGBUILD, and I suspect you'll fix your problem ... then be sure the let the maintainer know. (edit: I have emailed bins)
EDIT: 'bins' has 36 AUR packages, and all that I checked have the same problem - all of them will create empty packages. The expectation that there be a package function has been around for quite a long time, however, I believe that only recently (w/ pacman 4.1?) did it lead to actual empty packages like these.
Last edited by Trilby (2013-05-16 18:09:19)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
The problem has been solve by adding the following lines to the file /etc/environment
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib
The code can now be compiled with
gcc -o name_of_executable `pkg-config --cflags --libs libcalg-1.0` main.c
Thanks
Offline
Uh. No. That's broken advice.
I dont understand what you mean by this!
Offline
He probably means that your advice is going to break other things trying to fix this.
Offline
Offline
That PKGBUILD is clearly a bit out-dated and broken (as faloncindy et al have pointed out), but it's not hard to fix:
# $Id: pkgbuild-mode.el,v 1.23 2007/10/20 16:02:14 juergen Exp $
# Maintainer: Sebastien Binet <binet@farnsworth>
pkgname=c-algorithms
pkgver=1.2.0
pkgrel=2
pkgdesc="A collection of many common data structures and algorithms for C"
url="http://c-algorithms.sourceforge.net/"
arch=('i686' 'x86_64')
license=('BSD')
depends=('glibc')
makedepends=('gcc')
source=("http://heanet.dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz")
md5sums=('d104d55ee9c97a2766b0850b44b6e85f') # I would change this to a sha256sum
build() {
cd "$pkgname-$pkgver"
./configure --prefix=/usr
make
}
package() {
cd "$pkgname-$pkgver"
make DESTDIR="${pkgdir}" install
}
The above should work a bit better if I'm not mistaken.
All the best,
-HG
Last edited by HalosGhost (2013-05-19 13:20:48)
Offline