Results 1 to 8 of 8

Thread: Use FLTK libraries with QtCreator

  1. #1
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Use FLTK libraries with QtCreator

    Hello everybody, I need to know how to integrate in a project created with QtCreator 4.6.2 libraries FLTK 1.3.1. The Operating System is Windows XP, and the compiler is MinGW 4.6.2.
    How do I write to the file. Pros to use the libraries FLTK ? Someone has never used ?

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Use FLTK libraries with QtCreator

    same as any other library. Add the include dirs and library dirs to your pro file. See the documents for help and example pro files.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Use FLTK libraries with QtCreator

    the problem is that it is not sufficient. Can not find references to objects of the FLTK library libfltk.a:
    Fl.cxx: -1: error: undefined reference to `OleUninitialize @ 0 '
    I put the following lines in my. pro:
    Qt Code:
    1. QT += core
    2. QT -= gui
    3. TARGET = fltk_hello
    4. CONFIG += console
    5. CONFIG -= app_bundle
    6. TEMPLATE = app
    7.  
    8. #------------------------------------------------
    9. #
    10. # Uso librerie FLTK 1.3.1
    11. #
    12. #------------------------------------------------
    13. INCLUDEPATH += C:/MinGW/include \
    14. C:/MinGW/FLTK/include
    15.  
    16. LIBS += C:/MinGW/FLTK/lib/libfltk.a \
    17. C:/MinGW/FLTK/lib/libfltk_forms.a \
    18. C:/MinGW/FLTK/lib/libfltk_gl.a \
    19. C:/MinGW/FLTK/lib/libfltk_images.a \
    20. C:/MinGW/FLTK/lib/libfltk_jpeg.a \
    21. C:/MinGW/FLTK/lib/libfltk_png.a \
    22. C:/MinGW/FLTK/lib/libfltk_z.a
    23.  
    24. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Use FLTK libraries with QtCreator

    then you're either missing some #defines to import symbols correctly (if importing shared libraries), or you haven't linked with the correct libraries, or perhaps something else is wrong.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Use FLTK libraries with QtCreator

    To compile the FLTK library 1.3.1 I used CMake and then make MinGW. The sample code used is based on FLTK:
    Qt Code:
    1. //#include <QCoreApplication>
    2.  
    3. #include <FL/Fl.H>
    4. #include <FL/Fl_Window.H>
    5. #include <FL/Fl_Box.H>
    6.  
    7. int main(int argc, char *argv[])
    8. {
    9. //QCoreApplication a(argc, argv);
    10.  
    11. Fl_Window *window = new Fl_Window(340,180);
    12. Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
    13. box->box(FL_UP_BOX);
    14. box->labelfont(FL_BOLD+FL_ITALIC);
    15. box->labelsize(36);
    16. box->labeltype(FL_SHADOW_LABEL);
    17. window->end();
    18. window->show(argc, argv);
    19. return Fl::run();
    20.  
    21. //return a.exec();
    22. }
    To copy to clipboard, switch view to plain text mode 

    I do not understand what is missing... No one has ever used the FLTK?

  6. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Use FLTK libraries with QtCreator

    why dont you ask on a fltk forum? This is a Qt programming forum, and your question has nothing to do with qt programming.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  7. #7
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Use FLTK libraries with QtCreator

    Ok, I wrote in the forum FLTK - general. Let's see what they tell me. But then you have to act on the file .pro of QtCreator to build the project

  8. #8
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [RESOLVED] Re: Use FLTK libraries with QtCreator

    Found the solution. Having the libraries FLTK 1.3.1 compiled (it can be easily done using the shell of MSYS (rxvt) with MinGW 4.6.2), this is to give the MSYS (rxvt) shell prompt the following command:

    Qt Code:
    1. fltk-config --ldstaticflags
    To copy to clipboard, switch view to plain text mode 

    in this way we obtain the flags necessary for the compilation of any example of using FLTK MinGW and consequently amche our beloved Qt Creator 2.6.0
    In my case for example I got:
    Qt Code:
    1. -mwindows /usr/local/lib/libfltk.a -lole32 -luuid -lcomctl32
    To copy to clipboard, switch view to plain text mode 
    Please note that:
    Qt Code:
    1. /usr/local/
    To copy to clipboard, switch view to plain text mode 
    is in
    Qt Code:
    1. C:\MinGW\msys\1.0\local
    To copy to clipboard, switch view to plain text mode 
    So in the project file of Qt we get:
    Qt Code:
    1. #------------------------------------------------
    2. #
    3. # Uso librerie FLTK 1.3.1
    4. #
    5. #------------------------------------------------
    6. INCLUDEPATH += C:/MinGW/include
    7.  
    8. LIBS += -mwindows C:/MinGW/lib/libfltk.a \
    9. C:/MinGW/lib/libfltk_forms.a \
    10. C:/MinGW/lib/libfltk_gl.a \
    11. C:/MinGW/lib/libfltk_images.a \
    12. C:/MinGW/lib/libfltk_jpeg.a \
    13. C:/MinGW/lib/libfltk_png.a \
    14. C:/MinGW/lib/libfltk_z.a \
    15. -lole32 -luuid -lcomctl32
    To copy to clipboard, switch view to plain text mode 
    For the curious here is the procedure to follow to compile the libraries FLTK 1.3.1 with MinGW 4.6.2 using MSYS (rxvt):
    1- copy the file fltk-1.3.1-source.tar.gz in /home/your-username/ of msys\1.0\ then give the command to
    MSYS shell (rxvt):
    Qt Code:
    1. tar xvzf fltk-1.3.1-source.tar.gz
    To copy to clipboard, switch view to plain text mode 
    2-
    Qt Code:
    1. cd fltk-1.3.1
    To copy to clipboard, switch view to plain text mode 
    3-
    Qt Code:
    1. ./configure & make & make install
    To copy to clipboard, switch view to plain text mode 
    will be installed in /usr/local/lib, /usr/local/include/FL, /usr/local/bin, /usr/local/share. Please note that /usr/local is C:\MinGW\msys\1.0\local
    Have fun with FLTK
    Last edited by giorgik; 14th December 2012 at 08:40. Reason: updated contents

Similar Threads

  1. QtCreator and external libraries
    By GiuseppeBonfa in forum Qt Tools
    Replies: 6
    Last Post: 21st May 2012, 23:26
  2. Replies: 0
    Last Post: 7th February 2012, 09:02
  3. Qt Creator Qtcreator and Pjsip error adding statically libraries
    By kazuya in forum Qt Tools
    Replies: 0
    Last Post: 16th November 2011, 15:49
  4. Replies: 4
    Last Post: 5th November 2011, 01:38
  5. QtCreator 2.0 crashes application working in QtCreator 1.3
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 12:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.