libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is this library not found?


From: Aljosha Papsch
Subject: Why is this library not found?
Date: Sun, 1 May 2016 13:42:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.2

Hello,

I librarified gneural_network, patches pending at:
https://lists.gnu.org/archive/html/gneuralnetwork/2016-04/msg00015.html
In that patch library is called libgneural_network, locally I modified name to libgneural.

Next I installed gneural_network at /opt:

/opt/gneural/
├── bin
│   └── gneural_network
├── include
│   └── gneural
│       ├── activation.h
│       ├── binom.h
│       ├── defines.h
│       ├── error.h
│       ├── fact.h
│       ├── feedforward.h
│       ├── genetic_algorithm.h
│       ├── gradient_descent.h
│       ├── includes.h
│       ├── load.h
│       ├── msmco.h
│       ├── parser.h
│       ├── randomize.h
│       ├── random_search.h
│       ├── rnd.h
│       ├── save.h
│       ├── simulated_annealing.h
│       └── structures.h
└── lib
    ├── libgneural.a
    ├── libgneural.la
    ├── libgneural.so -> libgneural.so.0.0.0
    ├── libgneural.so.0 -> libgneural.so.0.0.0
    └── libgneural.so.0.0.0

I try to load that library with lt_dlopen:

#include <ltdl.h>
#include <stdio.h>

int
main (int argc, char** argv)
{
  lt_dlhandle handle;
  lt_dlinit ();
  handle = lt_dlopen ("libgneural");
  if (handle != NULL)
    {
      printf ("Loaded library\n");
      lt_dlclose (handle);
    }
  else
    {
      printf (lt_dlerror ());
      printf ("\n");
    }
  return 0;
}

This program fails with error message: file not found. What am I doing wrong? The command line is:
$ gcc -l ltdl -o dlopen dlopen.c
$ LD_LIBRARY_PATH=/opt/gneural/lib ./dlopen

Best regards
Aljosha Papsch



reply via email to

[Prev in Thread] Current Thread [Next in Thread]