You are not logged in.

#1 2013-05-16 02:39:15

sprinf
Member
From: Buea, Cameroon
Registered: 2013-03-20
Posts: 31
Website

C-Algorithms package

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

#2 2013-05-16 02:47:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,442

Re: C-Algorithms package

Moving to AUR issues.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Offline

#3 2013-05-16 02:50:32

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,220
Website

Re: C-Algorithms package

it looks like that should be libcalg-1.0 as that is the name of the pc file in the package.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#4 2013-05-16 17:54:46

sprinf
Member
From: Buea, Cameroon
Registered: 2013-03-20
Posts: 31
Website

Re: C-Algorithms package

Trilby wrote:

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

#5 2013-05-16 18:02:51

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,220
Website

Re: C-Algorithms package

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)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#6 2013-05-16 18:48:57

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: C-Algorithms package

The problem is the use of $startdir/pkg, not that there's exists no package() function. The latter is still supported until pacman 4.2.

Offline

#7 2013-05-18 06:05:20

sprinf
Member
From: Buea, Cameroon
Registered: 2013-03-20
Posts: 31
Website

Re: C-Algorithms package

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

#8 2013-05-18 15:44:44

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: C-Algorithms package

Uh. No. That's broken advice.

Offline

#9 2013-05-18 19:47:29

sprinf
Member
From: Buea, Cameroon
Registered: 2013-03-20
Posts: 31
Website

Re: C-Algorithms package

falconindy wrote:

Uh. No. That's broken advice.

I dont understand what you mean by this!

Offline

#10 2013-05-18 22:54:44

Hspasta
Member
Registered: 2011-12-24
Posts: 187
Website

Re: C-Algorithms package

He probably means that your advice is going to break other things trying to fix this.

Offline

#11 2013-05-19 12:59:42

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: C-Algorithms package

I mean that anyone installing this from the package isn't going to have that problem. You've clearly chosen 'make install' as your undocumented solution here, which is entirely not the point of the thread (to fix the PKGBUILD).

Offline

#12 2013-05-19 13:18:13

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: C-Algorithms package

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)


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

Board footer

Powered by FluxBB