FLTK logo

Re: [fltk.general] How I get and glue the FLTK dependecies in my application?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: How I get and glue the FLTK dependecies in my application? Daniel Silva Jul 28, 2022  
 
-_-, gee, you are right.

I remember I tried to pull the relative and got an error from my fish shell, and I didn't investigate(maybe I typed wrong or maybe fltk build was clean), I think when I pulled the system one in my head it was coming from the relative path, without realizing that I was not using either the absolute or relative path to the RIGHT script.
Greg, thank you for your time.

On Thu, Jul 28, 2022 at 12:27 PM Greg Ercolano <erco@seriss.com> wrote:

On 7/28/22 07:12, Daniel Silva wrote:

Thank you.

However --ldstaticflags returns the fltk installation to link with "/usr/local/lib/libfltk.a", and doesn't return all the fltk dependencies, so I got linking errors.
--ldstaticflags returns "/usr/local/lib/libfltk.a -lXrender -lXft -lfontconfig -pthread -lpthread -lm -lX11"
But the first definition of LDLIBS var in fltk-config is "LDLIBS=" -lm -lX11 -lXext -lpthread -lXinerama -lXfixes -lXcursor -lXft -lXrender -lm -lfontconfig -ldl"
And works fine.

    Here's what I get when I run fltk-config and use just --ldstaticflags:
# /usr/local/src/fltk-1.4.x-git/fltk-config --ldstaticflags
/usr/local/src/fltk-1.4.x-git/lib/libfltk.a -lXrender -lXcursor -lXfixes -lXft -lfontconfig -lXinerama -pthread -lpthread -ldl -lm -lX11
   ..which looks a lot like your correct flags.

    IMPORTANT: Are you sure your Makefile is invoking fltk-config with an absolute path
    to the fltk-config in your app dir? e.g. /usr/you/project/fltk-1.4.x/fltk-config
    It doesn't have to be an absolute path, it can be relative. Just as long
    as it points to the specific version of FLTK your app is trying to build with.

    If you're just running 'fltk-config' (without a path), then you're probably picking up
    whatever random version of FLTK that's installed on your machine and is in your PATH,
    and that probably has very different build flags that are wrong for your app.

    Point make to the correct fltk-config script, as there will be one fltk-config for
    each version of FLTK, so you have to run the matching one to the one you're
    compiling and linking against.

    Also, if you have a version of fltk installed as part of the OS on your machine
    (e.g. with 'apt' or 'yum'), then be sure when you have #include <FL/Fl.H>
    in your code that it's not picking up /usr/include/FL, as that might not be
    compatible with the FLTK you want to build with. This is why Ian suggested
    you do not install FLTK on a machine (yum/apt/etc) if you're working with
    multiple FLTK versions; it can create all kinds of problems when #include files
    picked up during compile (e.g. /usr/include/FL) don't match the fltk libraries
    you're linking with (e.g. /some/where/yourproject/fltk-1.4.x/..)


--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/vj6Z_3KufEw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/567a2ebb-d809-1e78-6c8e-deec2812f4de%40seriss.com.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CALJRLysq2t2UDszcKFsNsur%3DP6XTHjTYzX_3PN06vcoqGR-4dQ%40mail.gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.