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 09:14 Jul 28 top right image
 

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

However I'm not interested in the fltk lib --ldflags or --ldstaticflags returns,
because I'm linking manually to the static fltk lib to my fltk build,

    Hmm, but what you say you want sounds exactly like what
    --ldstaticflags is meant for.

    It returns the static version of fltk's lib and the system dependencies.

    So just be sure to not specify libfltk.a in your Makefile, and let --ldstaticflags
    specify it for you.

    I think the problem you're having with --ldstaticflags returning unexpected results
    is a different issue, perhaps due to picking up the wrong fltk-config script.

    --ldstaticflags is probably what you should use, me thinks.

    Try a simple test with something small; create a new project directory.
    Then create a simple hello.cpp file in that directory:
#include <FL/Fl_Double_Window.H>
int main() {
    Fl_Double_Window win(200,200,"test");
    win.show();
    return Fl::run();
}
    Then create a Makefile, with an FLTKCONFIG line at the top that
    points to the fltk-1.4.x directory of your other project, e.g.
FLTKCONFIG=/path/to/your/other/project/fltk-1.4.x/fltk-config
       CXX=$(shell $(FLTKCONFIG) --cxx)
  CXXFLAGS=$(shell $(FLTKCONFIG) --cxxflags)
   LDFLAGS=$(shell $(FLTKCONFIG) --ldstaticflags)

# CREATE EXECUTABLE FROM OBJ
hello: hello.o
    $(CXX) hello.o $(LDFLAGS) -o hello

# COMPILE .cpp -> .obj
hello.o: hello.cpp
    $(CXX) $(CXXFLAGS) hello.cpp -c

clean:
    -/bin/rm hello.o hello
    Then try 'make'. It should build hello and link with FLTK statically
    using the FLTK library your other project is using.

    It should work, assuming that version of FLTK was built recently
    on this operating system.

--
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/5cb3348b-041a-1871-7c31-61c69da171ac%40seriss.com.
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

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