Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABI breakage causes kiwix-tools to not compile #645

Closed
juuz0 opened this issue Nov 10, 2023 · 6 comments
Closed

ABI breakage causes kiwix-tools to not compile #645

juuz0 opened this issue Nov 10, 2023 · 6 comments
Assignees
Milestone

Comments

@juuz0
Copy link
Collaborator

juuz0 commented Nov 10, 2023

/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/libkiwix.so: undefined reference to `zim::Item::getPath[abi:cxx11]() const'
collect2: error: ld returned 1 exit status

I suspect this issue was introduced in: openzim/libzim#836

@kelson42 kelson42 added the bug label Nov 10, 2023
@kelson42 kelson42 added this to the 3.6.0 milestone Nov 10, 2023
@mgautierfr
Copy link
Member

Which version of libzim do you using ?
How do you compile kiwix-tools ?


openzim/libzim#836 is a ABI breakage, not a API. So recompiling should be ok.

@juuz0
Copy link
Collaborator Author

juuz0 commented Nov 13, 2023

Which version of libzim do you using ?

latest main branch

How do you compile kiwix-tools ?

the usual README way.

meson . build
sudo ninja -C build install

Full error:

[3/7] Linking target src/searcher/kiwix-search
FAILED: src/searcher/kiwix-search 
c++  -o src/searcher/kiwix-search src/searcher/kiwix-search.p/kiwix-search.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/usr/local/lib/x86_64-linux-gnu -Wl,-rpath-link,/usr/local/lib/x86_64-linux-gnu -pthread -Wl,--start-group /usr/local/lib/x86_64-linux-gnu/libkiwix.so /usr/local/lib/x86_64-linux-gnu/libzim.so /usr/lib/x86_64-linux-gnu/liblzma.so /usr/lib/x86_64-linux-gnu/libzstd.so /usr/lib/x86_64-linux-gnu/libicui18n.so /usr/lib/x86_64-linux-gnu/libicuuc.so /usr/lib/x86_64-linux-gnu/libicudata.so /usr/lib/x86_64-linux-gnu/libpugixml.so /usr/lib/x86_64-linux-gnu/libcurl.so /usr/lib/x86_64-linux-gnu/libmicrohttpd.so /usr/lib/x86_64-linux-gnu/libxapian.so -Wl,--end-group
/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/libkiwix.so: undefined reference to `zim::Item::getPath[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
[5/7] Linking target src/manager/kiwix-manage
FAILED: src/manager/kiwix-manage 
c++  -o src/manager/kiwix-manage src/manager/kiwix-manage.p/kiwix-manage.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/usr/local/lib/x86_64-linux-gnu -Wl,-rpath-link,/usr/local/lib/x86_64-linux-gnu -pthread -Wl,--start-group /usr/local/lib/x86_64-linux-gnu/libkiwix.so /usr/local/lib/x86_64-linux-gnu/libzim.so /usr/lib/x86_64-linux-gnu/liblzma.so /usr/lib/x86_64-linux-gnu/libzstd.so /usr/lib/x86_64-linux-gnu/libicui18n.so /usr/lib/x86_64-linux-gnu/libicuuc.so /usr/lib/x86_64-linux-gnu/libicudata.so /usr/lib/x86_64-linux-gnu/libpugixml.so /usr/lib/x86_64-linux-gnu/libcurl.so /usr/lib/x86_64-linux-gnu/libmicrohttpd.so /usr/lib/x86_64-linux-gnu/libxapian.so -Wl,--end-group
/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/libkiwix.so: undefined reference to `zim::Item::getPath[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

I suspect that commit/PR because openzim/libzim@2a810ac compiles without any issues.

I'm on Ubuntu 23.10
gcc 13.2.0

@mgautierfr
Copy link
Member

Which version of kiwix-tools are you using ?
We have switch to cpp17 so we shouldn't have a [abi:cxx11].

@juuz0
Copy link
Collaborator Author

juuz0 commented Nov 16, 2023

kiwix-tools is also the latest/main branch, i was compiling it on a new installation. Apologies for the late reply. Let me know if I need to provide other info.

@mgautierfr
Copy link
Member

c++ -o src/searcher/kiwix-search src/searcher/kiwix-search.p/kiwix-search.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/usr/local/lib/x86_64-linux-gnu -Wl,-rpath-link,/usr/local/lib/x86_64-linux-gnu -pthread -Wl,--start-group /usr/local/lib/x86_64-linux-gnu/libkiwix.so /usr/local/lib/x86_64-linux-gnu/libzim.so /usr/lib/x86_64-linux-gnu/liblzma.so /usr/lib/x86_64-linux-gnu/libzstd.so /usr/lib/x86_64-linux-gnu/libicui18n.so /usr/lib/x86_64-linux-gnu/libicuuc.so /usr/lib/x86_64-linux-gnu/libicudata.so /usr/lib/x86_64-linux-gnu/libpugixml.so /usr/lib/x86_64-linux-gnu/libcurl.so /usr/lib/x86_64-linux-gnu/libmicrohttpd.so /usr/lib/x86_64-linux-gnu/libxapian.so -Wl,--end-group
/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/libkiwix.so: undefined reference to `zim::Item::getPathabi:cxx11 const'
collect2: error: ld returned 1 exit status

You are linking with a "installed" libkiwix, not the one currently being compiled (and tested here).

You probably have a already (old version) libkiwix installed.

@kelson42
Copy link
Contributor

Yes, compilation/execution works with ubuntu 22.04. This is typically a sympton of linking against the wrong version of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants