Re: Duplicate libraries in fox-config output

[email protected] Fri, 26 Jul 2024 07:12:52 -0500
Newsgroups gmane.comp.lib.fox-toolkit.user
Message-ID <[email protected]>
On 2024-07-26 02:02, Michael Behrisch via Foxgui-users wrote:
> Hi,
> I have a question about the output of "fox-config --libs".
> On my system it currently gives: "-L/usr/lib64 -lFOX-1.6 -lX11 -lXext
> -lfreetype -lfontconfig -lXft -lXcursor -lXrender -lXrandr -lXfixes
> -lXi -lGL -lGLU -ldl -lpthread -lrt -ljpeg -lpng -ltiff -lz -lbz2
> -lGLU -lGL"
> which duplicates the GL and GLU libraries.
> 
> The problem is that recent macOS builds complain if you link the same
> library twice.
> 
> I had a look at the source code in configure.ac and fox-config.in and
> this seems to be intentional because indeed the GL libraries (LIBGL)
> are being added to the LIBS variable and then both are output in the
> end.
> I removed the first addition of the GL libs and it is still working
> fine here but before submitting a patch I wanted to ask whether there
> is a known reason for this duplication because sometimes the linker is
> tricky.
> 

I think its OK to remove the duplicate.  W.r.t. multiple repetitions of 
the same library, I remember occasionally having to do this for 
resolving forward referencing, i.e. linker not knowing how to handle 2 
libraries mutually referring to each other.

Not sure if this is still necessary, linkers have perhaps evolved...

    -- JVZ