C/C++ Undefined symbol libintl_gettext

driker

New Member


Messages: 16

No matter what I try I cannot seem to get anything to link with libintl_gettext. I have gettext installed (I've tried installed different versions after deinstalling whatever version I've tested with.) and cannot figure out why I keep getting the error:
Code:
ld: error: undefined symbol: libintl_gettext
Has anyone run into this before or have any possible fixes? Been working at this for a couple of hours on and off and hit a dead end.
 

Emrion

Aspiring Daemon

Reaction score: 210
Messages: 675

Maybe you should tell us the exact command you used to compile / link.

Actually, libintl_gettext is present in /usr/local/lib/libintl.so (which is a link that points to libintl.so.8.2.0 on my system).
Code:
% nm --dynamic /usr/local/lib/libintl.so | grep libintl_gettext
00000000000044a0 T libintl_gettext
 
OP
D

driker

New Member


Messages: 16

Maybe you should tell us the exact command you used to compile / link.

Actually, libintl_gettext is present in /usr/local/lib/libintl.so (which is a link that points to libintl.so.8.2.0 on my system).
Code:
% nm --dynamic /usr/local/lib/libintl.so | grep libintl_gettext
00000000000044a0 T libintl_gettext

I've been trying to go through the source to find what may be the issue but due to the fact that many of the files are ".c.o" extensions it leaves me with limited options and searching through the ninja build files don't seem to be much help . I have fixed all other compilation issues that I've come across until this point but this one seems pretty illusive. I have attached the build.ninja file. (Had to add .txt extension at the end to get it to upload. It is not present in the normal file.)

The command was "ninja".

This is what followed:
Code:
ninja
[1/4] Linking target src/bin/edi
FAILED: src/bin/edi 
cc  -o src/bin/edi src/bin/edi.p/edi_config.c.o src/bin/edi.p/edi_consolepanel.c.o src/bin/edi.p/edi_content.c.o src/bin/edi.p/edi_content_provider.c.o src/bin/edi.p/edi_debug.c.o src/bin/edi.p/edi_debugpanel.c.o src/bin/edi.p/edi_file.c.o src/bin/edi.p/edi_filepanel.c.o src/bin/edi.p/edi_logpanel.c.o src/bin/edi.p/edi_main.c.o src/bin/edi.p/edi_searchpanel.c.o src/bin/edi.p/edi_theme.c.o src/bin/edi.p/editor_edi_editor.c.o src/bin/edi.p/editor_edi_editor_documentation.c.o src/bin/edi.p/editor_edi_editor_search.c.o src/bin/edi.p/language_edi_language_provider.c.o src/bin/edi.p/mainview_edi_mainview.c.o src/bin/edi.p/mainview_edi_mainview_item.c.o src/bin/edi.p/mainview_edi_mainview_panel.c.o src/bin/edi.p/screens_edi_about.c.o src/bin/edi.p/screens_edi_file_screens.c.o src/bin/edi.p/screens_edi_screens.c.o src/bin/edi.p/screens_edi_settings.c.o src/bin/edi.p/screens_edi_settings_font.c.o src/bin/edi.p/screens_edi_welcome.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group src/lib/libedi.so.0.8.0 /usr/local/lib/libelementary.so /usr/local/lib/libecore_evas.so /usr/local/lib/libecore_file.so /usr/local/lib/libecore_input.so /usr/local/lib/libecore_imf.so /usr/local/lib/libecore_con.so /usr/local/lib/libedje.so /usr/local/lib/libevas.so /usr/local/lib/libecore.so /usr/local/lib/libector.so /usr/local/lib/libluajit-5.1.so /usr/local/lib/libeldbus.so /usr/local/lib/libethumb_client.so /usr/local/lib/libethumb.so /usr/local/lib/libemotion.so /usr/local/lib/libefreet.so /usr/local/lib/libeio.so /usr/local/lib/libeet.so /usr/local/lib/libemile.so /usr/local/lib/libefl.so /usr/local/lib/libeo.so /usr/local/lib/libeina.so -pthread -lm -lrt -ldl -lkvm -Wl,--end-group '-Wl,-rpath,$ORIGIN/../lib' -Wl,-rpath-link,/usr/home/driker/Dev/enlightenment/edi-0.8.0/build/src/lib
 

Attachments

  • build.ninja.txt
    106.9 KB · Views: 30

Emrion

Aspiring Daemon

Reaction score: 210
Messages: 675

I have no knowledge of ninja. Looking at the command line it uses (cc ...), I just can say that it lacks /usr/local/lib/libintl.so after --start-group.
You can try to add it in your config file, line 277, after "--start-group". This worth a try, I think.
 

memreflect

Well-Known Member

Reaction score: 218
Messages: 253

I have devel/gettext-runtime installed on my system, which contains the necessary libintl.a file or libintl.so file.

I also need to set the LDFLAGS environment variable to -L/usr/local/lib to make Meson find the library at setup/configuration time, as in
Code:
env 'LDFLAGS=-L/usr/local/lib' meson setup -- builddir

Edit: If you're wondering why there's a problem, it's because Edi doesn't know that the 'elementary' package depends on libintl; pkgconf --libs elementary doesn't include -lintl since that's in the Libs.private field of elementary.pc, and private fields aren't printed to stdout. Meson thinks not having gettext/intl support is fine since it's not required, and the build fails when Edi isn't linked with the public 'elementary' libs and the necessary private libs that 'elementary' depends upon.
 
Last edited by a moderator:
OP
D

driker

New Member


Messages: 16

Thank you all for the suggestions. Sorry for the long response time. Been dealing with quarantine type stuff. This is my first time using meson or ninja so it's all new to me. I will try adding it to the ninja config file as Emrion suggested and running the env command.
 
OP
D

driker

New Member


Messages: 16

Thank you all for the suggestions. Sorry for the long response time. Been dealing with quarantine type stuff. This is my first time using meson or ninja so it's all new to me. I will try adding it to the ninja config file as Emrion suggested and running the env command.
That worked. Thank you,
 
Top