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?

1
  • See this answer. Commented Aug 7, 2012 at 9:27

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

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 When I read the if statement, it occurs to me as: d_name begins with "lib" or "ld-" or d_name ends with .so.
Hmm yes your right, i've been confused by the macro and read it a bit quickly, lunch time.
Then why does ldconfig ignore my hAcq*.so files unless I rename them libhAcq*.so ? Is there some kind of workaround?
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.