You are not logged in.
I'm trying to create my own PKGBUILD, for the AUR, that will be used
as a tool to install my library.
I'm encountering an issue while trying to link my test c file with the library.
gcc main.c -ldimanet -o mainOutputting the following error:
/sbin/ld: cannot find -ldimanet: No such file or directory
collect2: error: ld returned 1 exit statusI've created a PKGBUILD for the library, ensuring that dimanet.c and dimanet.h
are placed in the appropriate directory (/usr/include). Despite this, it seems
like the linker can't find the library.
Here's the PKGBUILD:
pkgname=dimanet
pkgver=1.2
pkgrel=1
pkgdesc="DimaNet is just a bad integration of a neural network library written in pure, ANSI C."
arch=('any')
url="https://github.com/dimalmfao/dimanet"
license=('GPL-3.0')
depends=('gcc')
source=("$pkgname-$pkgver.tar.gz::https://github.com/dimalmfao/dimanet/archive/master.tar.gz")
sha256sums=('SKIP')
prepare() {
tar -xf "$srcdir/$pkgname-$pkgver.tar.gz" -C "$srcdir/"
}
package() {
cd "$srcdir/dimanet-master"
mkdir -p "$pkgdir/usr/include"
cp dimanet.c dimanet.h "$pkgdir/usr/include/"
}Last edited by dimalmfao (2024-06-02 19:54:08)
Offline
The linker would be looking for libdimanet.so or libdimanet.a in the standard linker search paths such as /usr/lib. The PKGBUILD does not install anything to /usr/lib.
Offline
The linker would be looking for libdimanet.so or libdimanet.a in the standard linker search paths such as /usr/lib. The PKGBUILD does not install anything to /usr/lib.
Can you explain me how to do it the correct way?
Offline
And you should not install the source (*.c) files to /usr/include, or really at all. You have to build the library and install the build library in the PKGBUILD (or ideally in the Makefile and the PKGBUILD will just run make and make install).
Here's a library I wrote:
PKGBUILD
source files, in particular see the Makefile.
Last edited by Trilby (2024-06-02 20:12:13)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
And you should not install the source (*.c) files to /usr/include, or really at all. You have to build the library and install the build library in the PKGBUILD (or ideally in the Makefile and the PKGBUILD will just run make and make install).
Oh, I see. Thanks.
Offline