5

I'm struggling to make MVTec Halcon 11 work on Ubuntu. Everything is in the right place but the program doesn't see the dynamic libraries needed for image acquisition (the cameras alone work fine, the driver is installed)

I added the path with the libraries to /etc/ld.so.conf and ran ldconfig -v but of the 28 files present in the directory (all "Shared Library" type and .so extension), only the "lib*.so" ones are linked. As a matter of fact, ALL the libraries in the output of ldconfig are called lib*something.

Oddly, if I add "lib" in front of the name of the files, they get linked (of course that wouldn't be alright with the software)

Why is that?

madth3
  • 7,275
  • 12
  • 50
  • 74
mfloris
  • 361
  • 4
  • 16

1 Answers1

4

From the man of ld.so and ld-linux.so

Section FILES :

lib*.so* shared libraries

And from glibc (./elf/ldconfig.c) :

 712       /* Does this file look like a shared library or is it a hwcap
 713          subdirectory?  The dynamic linker is also considered as
 714          shared library.  */
 715       if (((strncmp (direntry->d_name, "lib", 3) != 0
 716             && strncmp (direntry->d_name, "ld-", 3) != 0)
 717            || strstr (direntry->d_name, ".so") == NULL)
 718           && (
 719 #ifdef _DIRENT_HAVE_D_TYPE
 720               direntry->d_type == DT_REG ||
 721 #endif
 722               !is_hwcap_platform (direntry->d_name)))
 723         continue;

Looks like you must choose a name begining with lib... The libc uses this to determine if the file may be a shared library.

Enjolras
  • 371
  • 2
  • 8
  • 2
    Thanks. Although it seems odd to me that someone would sell you a commercial software that cannot work just because of the way they named their files... – mfloris Aug 07 '12 at 10:05
  • 1
    @mfloris When I read the `if` statement, it occurs to me as: d_name begins with "lib" or "ld-" `or` d_name ends with `.so`. – ott-- Aug 07 '12 at 12:16
  • Hmm yes your right, i've been confused by the macro and read it a bit quickly, lunch time. – Enjolras Aug 07 '12 at 12:42
  • Then why does ldconfig ignore my hAcq*.so files unless I rename them libhAcq*.so ? Is there some kind of workaround? – mfloris Aug 08 '12 at 07:12
  • 5
    You don't need to rename the files. Note that instead of using `-lfoo` , you can just use the full path without the `-l` , e.g. `/home/bar/foo.so.2` . This will permit you to use non standard names, or specific versions. – JDiMatteo Mar 30 '15 at 21:01