Results 1 to 5 of 5

Thread: Cannot compile examples

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2014
    Posts
    30
    Thanks
    4
    Qt products
    Qt5

    Default Cannot compile examples

    I've installed qwt to /usr/local/qwt-6.1.0 and I put the source in /usr/src/qwt-6.1.0. When I try to compile the examples with qmake/make I get the following problem:

    Qt Code:
    1. $ cd /usr/src/qwt-6.1.0/examples
    2. $ qmake
    3. $ make
    4. ...
    5. make[1]: Entering directory `/usr/src/qwt-6.1.0/examples/animation'
    6. linking ../bin/animation
    7. /usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::unregisterConverterFunction(int, int)'
    8. /usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::registerConverterFunction(QtPrivate::AbstractConverterFunction const*, int, int)'
    9. /usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QScrollArea::viewportSizeHint() const'
    10. /usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::hasRegisteredConverterFunction(int, int)'
    11. collect2: error: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    This is kind of odd. What am I missing?

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,313
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Cannot compile examples

    Usually the examples are linked against the libs that have been build before in /usr/src/qwt-6.1.0/lib - in your case they seem to be linked against different ones, that have been installed before in /usr/local/qwt-6.1.0/lib.
    ( Note that this is special for the examples, regular applications should indeed link against the version installed in /usr/local/qwt-6.1.0/lib ),

    If you didn't patch the project files yourself, disable "CONFIG += silent" in qwtbuild.pri, so that we can see, why the examples try to link the wrong libs.

    Uwe

  3. #3
    Join Date
    Jun 2014
    Posts
    30
    Thanks
    4
    Qt products
    Qt5

    Default Re: Cannot compile examples

    I added /usr/src/qwt-6.1.0/lib to /etc/ld.so.conf which is why those libs were being picked up. I removed the entry and it compiles great. So thank you for that!!

    Can I ask why the examples are "special" from ordinary applications? Why do they use different libraries? I'm using the examples to learn how to do Qwt in my application but it strikes me odd that what I am learning is not supported by the installed libs.

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,313
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Cannot compile examples

    Quote Originally Posted by jmalicke View Post
    I added /usr/src/qwt-6.1.0/lib to /etc/ld.so.conf which is why those libs were being picked up.
    ld.so.conf is for linking dynamically at runtime and doesn't explain any issues, when building an application. So whatever you did - I question, that this was the solution.

    Quote Originally Posted by jmalicke View Post
    Can I ask why the examples are "special" from ordinary applications? Why do they use different libraries?
    In general libraries ( and applications ) are build locally and installed somewhere later in an extra step - usually by "make install".

    The Qwt examples are part of the Qwt package and the intention is that you can build them without having to install something. That's why they are linked against the local libs. Of course they could be linked against installed libs as well, but the project files ( -> makefiles ) of the examples are not written this way.

    Uwe

Similar Threads

  1. Error when compile/run Qt examples
    By babygal in forum Newbie
    Replies: 5
    Last Post: 9th March 2011, 11:51
  2. how can i don't compile qt demos and examples?
    By rainspider in forum Installation and Deployment
    Replies: 4
    Last Post: 7th November 2009, 16:58
  3. to compile and run qtopia examples for greenphone
    By prajna in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 15th April 2009, 10:00
  4. Qt State Machine Examples don't compile
    By vitalyx in forum Newbie
    Replies: 0
    Last Post: 4th April 2009, 14:19
  5. compile opengl examples
    By balinsky in forum Qt Programming
    Replies: 5
    Last Post: 16th February 2009, 00:33

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.