Solved Linker error

Hello,

I'm trying to compile some test code like this: cc -Wall -g -o tutorial main.c `pkg-config --cflags --libs gtk+-2.0` -export-dynamic but the linker complains:
Code:
/usr/bin/ld: cannot find -lintl
libintl exists and is found by ldconfig -r. This follows having run pkg delete -f gettext and pkg upgrade as per the most recent /usr/ports/UPDATING file.

Thanks for any suggestions.

sprock
 
You probably need to add:
Code:
-L/usr/local/lib -I/usr/local/include
They're not included by default.
 
The pkg-config thing should add all the right -I, -l and -L flags.
Indeed. I fixed (really, worked around) the problem by using the output of pkg-config but removing the call to -lintl.

Thanks to both of you for your help.

sprock
 
Do keep in mind that it's exactly what you called it: a workaround, not a real fix. It shouldn't be necessary.
 
I made a symlink from libintl.so to libintl.so.8.1.2 in /usr/local/lib. Using -lintl as part of the compiler invocation then works.

Looking in /usr/ports/devel/gettext-runtime the pkg-plist shows libintl.so.9 and libintl.so in addition to the libintl.so.8 and libintl.so.8.1.2 that were installed using the binary package in the repository. Thus, building the port seems to be the best fix.

Thanks again.

sprock
 
Back
Top