Add missing LDFLAGS for zlib (to Makefile)

Discuss new features and functions
Posts: 44
Joined: 14 Aug 2022

daviank

Hi Zenju, when trying to build freefilesync I noticed that the LDFLAGS for zlib are missing. May I suggest you to add these lines to your Makefile (both FFS & RFS). They could be placed near the equivalent lines for the other libraries.
CXXFLAGS  += `pkg-config --cflags zlib`
LDFLAGS += `pkg-config --libs zlib`
This would automatically add the correct flag, usually "-lz" in that case.
User avatar
Site Admin
Posts: 7210
Joined: 9 Dec 2007

Zenju

The "-lz" is already added by "wx-config"
Posts: 44
Joined: 14 Aug 2022

daviank

Thank you for your reply. Apparently on my system it is not:
$ wx-config --libs std, aui, richtext --debug=no
-L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk3u_aui-3.2 -lwx_gtk3u_richtext-3.2 -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2
[code]
Posts: 44
Joined: 14 Aug 2022

daviank

Since the file (zen/zlib_wrap.cpp) that uses it in your code base doesn't apparently depend on wx-widget neither on gtk, I thought it had to be present in the Makefile. But I could be wrong.
Posts: 44
Joined: 14 Aug 2022

daviank

I actually had the same problem with gtk LDFLAGS which are missing at link time, so I had to add them with
LDFLAGS += `pkg-config --libs gtk+-3.0`
Would you add them to the Makefile please?

Error was:
/usr/bin/ld: /tmp/cc6adrRa.ltrans115.ltrans.o: undefined reference to symbol 'gtk_css_provider_load_from_path'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgtk-3.so.0: error adding symbols: DSO missing from command line

"gtk_css_provider_load_from_path" is used in both
- FreeFileSync/Source/application.cpp
- FreeFileSync/Source/RealTimeSync/application.cpp