On 26/06/2019 22:17, Nelson H. F. Beebe wrote:
$ nm /lib/x86_64-linux-gnu/libfreetype.so
nm: /lib/x86_64-linux-gnu/libfreetype.so: no symbols

Add the -D (--dynamic) option; I wish that nm wasn't so stupid to need
it:

Ah! I didn't know that. Using -D does indeed list FT_Init_FreeType!


--------------------------------------------------

P.S. One more thing to check when linking fails to find an expected
function in a library is the freshness of the loader cache: as root,
run

        # ldconfig

to update the cache.

Sadly, that didn't work.


You can also run the system call tracer to find out where library
files are looked for, and whether they are found, and then
successfully opened:

        % strace -o foo.log -f cc foo.c -lbar
        % fgrep -i 'open(' foo.log
        % fgrep -i 'stat(' foo.log


Ah, now this is interesting. The bottom of foo.log has this:

16892 stat("/usr/lib/gcc/x86_64-linux-gnu/8/libfreetype.so", 0x7ffeecb07830) = -1 ENOENT (No such file or directory) 16892 openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu/8/libfreetype.so", O_RDONLY) = -1 ENOENT (No such file or directory) 16892 stat("/usr/lib/gcc/x86_64-linux-gnu/8/libfreetype.a", 0x7ffeecb07880) = -1 ENOENT (No such file or directory) 16892 openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu/8/libfreetype.a", O_RDONLY) = -1 ENOENT (No such file or directory) 16892 stat("/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfreetype.so", {st_mode=S_IFREG|0644, st_size=759720, ...}) = 0 16892 openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfreetype.so", O_RDONLY) = 7 16892 openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfreetype.so", O_RDONLY) = 8

That's certainly not the library path that libfreetype.so has been put in!

So ... is g++ looking in the wrong place for library files?

Kris.

_______________________________________________
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to