Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Creation of .dll file using build option in Qt-Creator
Forum Updated to NodeBB v4.3 + New Features

Creation of .dll file using build option in Qt-Creator

Scheduled Pinned Locked Moved C++ Gurus
8 Posts 5 Posters 16.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sandeepv
    wrote on 7 May 2013, 21:45 last edited by
    #1

    Hi

    I have a project which has to create a .dll file when run in debug or release modes. But i see no .dll file is created, but it shows a .exe file created instead. Please help me out how to create a .dll file. Please tell me what is the mistake i'm making.

    Thank you in advance.

    • Sandeep
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on 7 May 2013, 22:51 last edited by
      #2

      Post your .pro file.
      Generally speaking should be

      @TEMPLATE=lib
      CONFIG += dll@

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sandeepv
        wrote on 8 May 2013, 15:54 last edited by
        #3

        Hi mcosta,

        Below is my .pro file.

        NAME = dll_example
        TEMPLATE = app
        CONFIG += console release
        CONFIG -= qt
        DEFINES += DIRECT_INCLUDE

        LIBS += jazznovoscreendatasource.lib

        #------------------------------------------------------

        datasource specific files

        SOURCES += main.cpp

        HEADERS += jazzport.h
        SOURCES += jazzport.cpp

        HEADERS += jazzstring.h
        SOURCES += jazzstring.cpp

        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/ -ljazznovoscreendatasource
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/ -ljazznovoscreendatasourced
        else:unix: LIBS += -L$$PWD/ -ljazznovoscreendatasource

        INCLUDEPATH += $$PWD/
        DEPENDPATH += $$PWD/

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on 9 May 2013, 05:57 last edited by
          #4

          Hi,

          how I said in the previous post, in your PRO file there isn't a TEMPLATE=lib.

          In your PRO youcreate an executable that link a library named jazznovoscreendatasource.

          What do you want instead?

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sandeepv
            wrote on 9 May 2013, 20:06 last edited by
            #5

            Hi,

            ya thats all.. Thank you. It worked fine. It was able to give me a .dll file. But i face a major problem with the .dll created. In the newly created .dll file, there is no method getting exported. I am trying to export 2 functions to the dll. But in the created dll there are no functions getting exported. Any idea with this??

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 9 May 2013, 21:15 last edited by
              #6

              Hi,

              Have a look at this "wiki":http://qt-project.org/wiki/How_to_create_a_library_with_Qt_and_use_it_in_an_application

              It should get you started.

              Hope it helps

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AlterX
                wrote on 10 Oct 2013, 09:16 last edited by
                #7

                just use:
                @
                TEMPLATE = lib
                @

                It will generate .dll under windows and .so under linux or other under other systems

                Qt Ambassador
                Real-time cooperative teams: http://www.softairrealfight.net
                Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                https://codereview.qt-project.org/...

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  ceora
                  wrote on 28 Oct 2013, 15:08 last edited by
                  #8

                  [quote author="sandeepv" date="1368129995"]Hi,

                  ya thats all.. Thank you. It worked fine. It was able to give me a .dll file. But i face a major problem with the .dll created. In the newly created .dll file, there is no method getting exported. I am trying to export 2 functions to the dll. But in the created dll there are no functions getting exported. Any idea with this??[/quote]

                  Ive got the same problem, if you use visual studio compiler try to add this to the file you nedd to export the function:

                  @#define DllExport __declspec( dllexport )@

                  and add DllExport before any function you need to export (in the header).

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved