icecc / icemon

Icecream GUI Monitor
http://kfunk.org/tag/icemon/
GNU General Public License v2.0
88 stars 34 forks source link

debian WSL compilation #58

Open janwilmans opened 4 years ago

janwilmans commented 4 years ago

icemon requires to link against libcap-ng and liblzo2 but the cmake files don't explicitly specify that. On normal debian 10 (buster) I did not experience any problems, and everything compiles even without these explicit dependencies specified.

However on, WSL (Windows Subsystem for Linux) debian buster reports:

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libicecc.a(libicecc_la-comm.o): in function `MsgChannel::writecompressed(unsigned char const*, unsigned long, unsigned long&)':
(.text+0x28a7): undefined reference to `lzo1x_1_compress'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libicecc.a(libicecc_la-comm.o): in function `MsgChannel::readcompressed(unsigned char**, unsigned long&, unsigned long&)':
(.text+0x9910): undefined reference to `lzo1x_decompress'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libicecc.a(libicecc_la-comm.o): in function `LoginMsg::LoginMsg(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text+0xb0be): undefined reference to `capng_have_capability'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

I had to add the libraries explicitly to make it link:

target_link_options(icemon PRIVATE -ldl /lib/x86_64-linux-gnu/libcap-ng.so.0 /lib/x86_64-linux-gnu/liblzo2.so.2)
janwilmans commented 4 years ago

and while on the topic of WSL, i had to strip out this capability check to work around:

icemon: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
janwilmans commented 4 years ago

And there we have it, icemon running on windows: image

llunak commented 4 years ago

icemon requires to link against libcap-ng and liblzo2 but the cmake files don't explicitly specify that.

Additional libraries are listed in icecc'd pkg-config file, and FindIcecream.cmake extracts it from there.

janwilmans commented 4 years ago

is there a step before cmake -G that I should have done then? Its not working for me (well, its working now, but it required the modification I described.)

llunak commented 4 years ago

Cmake uses pkg-config to find the file, so pkg-config needs to be able to find it. But unless you use old icemon, cmake should fail it pkg-config fails. So unless you provide more details about your cmake run, I don't know.