freetype
[Top][All Lists]
Advanced

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

Re: [ft] Linking against freetype in Linux


From: Kris
Subject: Re: [ft] Linking against freetype in Linux
Date: Wed, 26 Jun 2019 22:28:19 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2



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.



reply via email to

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