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? Greg Ercolano Jul 28, 2022  
 

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 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/567a2ebb-d809-1e78-6c8e-deec2812f4de%40seriss.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'.