Results 1 to 3 of 3

Thread: Shared lib build output

  1. #1
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Shared lib build output

    Hi, when I try to build a shared lib with QMake (on Linux) I obtain 4 output files:

    Qt Code:
    1. libxxx.so
    2. libxxx.so.1
    3. libxxx.so.1.0
    4. libxxx.so.1.0.0
    To copy to clipboard, switch view to plain text mode 

    This is the .pro file:

    Qt Code:
    1. TARGET = test
    2. TEMPLATE = lib
    3. CONFIG += shared dll
    4. DEFINES += TEST_LIBRARY
    5. SOURCES += test.cpp
    6. HEADERS += test.h\
    7. test_global.h
    To copy to clipboard, switch view to plain text mode 

    The global define header:

    Qt Code:
    1. #ifndef TEST_GLOBAL_H
    2. #define TEST_GLOBAL_H
    3.  
    4. #include <QtCore/qglobal.h>
    5.  
    6. #if defined(TEST_LIBRARY)
    7. # define TESTSHARED_EXPORT Q_DECL_EXPORT
    8. #else
    9. # define TESTSHARED_EXPORT Q_DECL_IMPORT
    10. #endif
    11.  
    12. #endif // TEST_GLOBAL_H
    To copy to clipboard, switch view to plain text mode 

    And the very trivial exported class declaration:

    Qt Code:
    1. #ifndef TEST_H
    2. #define TEST_H
    3.  
    4. #include "test_global.h"
    5.  
    6. class TESTSHARED_EXPORT Test {
    7. public:
    8. Test();
    9. };
    10.  
    11. #endif // TEST_H
    To copy to clipboard, switch view to plain text mode 

    Is it normal?

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shared lib build output

    I'd say so, yes. Having multiple files detailing the version more and more allows your applications to choose how closely they want to follow the libraries versions.

  3. The following user says thank you to e8johan for this useful post:

    zuck (5th May 2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Shared lib build output

    Ok, thanks

Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  2. build debug with shared and release with static?
    By Thor28 in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2008, 22:32
  3. Please Help-->have few doubts with Static build in Windows !
    By Krish in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2008, 14:37
  4. Build error on mac Platform::WaitMouseMoved
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2007, 13:18
  5. shared versus static build
    By jcr in forum Installation and Deployment
    Replies: 2
    Last Post: 28th January 2006, 08:05

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.