Results 1 to 2 of 2

Thread: Shared Library Creation

  1. #1
    Join Date
    Jun 2008
    Location
    UK
    Posts
    35
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Shared Library Creation

    Hi,

    I was wondering if someone could point me to some docs, or give me a small example of some code for a simple shared library. Basically I want to create a lib with 2 functions in it that can be loaded with QLibrary, ideally the code will cross compile easily for a .so on Linux and .dll on windows.

    I might be mixing C with C++ in the library's, and from what ive read i might have to declare 'extern c' or something

    Anyone have a simple generic example for a library file, along with a qmake file?

    Thanks very much

  2. #2
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shared Library Creation

    I's been a while since I've done something like this but, I think, for qmake you just need to specify TEMPLATE = lib and the rest of the options are the same for any qmake project.
    For more specific qmake's settings, search for qmake on assistant.

    For shared libraries themselves, you might want to ask google about that, it will help you better than I, but I did a search "how to create c++ shared libraries" and the first result is this:
    http://www.iram.fr/~roche/code/c++/c++_AddNumbers.html

    Hope it helps.
    Kandalf
    There's no place like ~

Similar Threads

  1. qmake: dependency of application on common shared library
    By PeterWurmsdobler in forum Qt Programming
    Replies: 5
    Last Post: 27th March 2009, 16:13
  2. Qt/Mac Shared Library
    By nareshqt in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2008, 07:21
  3. Compiled resources in shared library
    By magland in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2007, 04:57
  4. shared library problem
    By nhatkhang in forum KDE Forum
    Replies: 9
    Last Post: 28th November 2006, 04:07
  5. HOW TO - created and use shared library (.so)
    By big4mil in forum Qt Programming
    Replies: 4
    Last Post: 25th November 2006, 23:11

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.