Creation of .dll file using build option in Qt-Creator
-
wrote on 7 May 2013, 21:45 last edited by
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
-
wrote on 7 May 2013, 22:51 last edited by
Post your .pro file.
Generally speaking should be@TEMPLATE=lib
CONFIG += dll@ -
wrote on 8 May 2013, 15:54 last edited by
Hi mcosta,
Below is my .pro file.
NAME = dll_example
TEMPLATE = app
CONFIG += console release
CONFIG -= qt
DEFINES += DIRECT_INCLUDELIBS += jazznovoscreendatasource.lib
#------------------------------------------------------
datasource specific files
SOURCES += main.cpp
HEADERS += jazzport.h
SOURCES += jazzport.cppHEADERS += jazzstring.h
SOURCES += jazzstring.cppwin32:CONFIG(release, debug|release): LIBS += -L$$PWD/ -ljazznovoscreendatasource
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/ -ljazznovoscreendatasourced
else:unix: LIBS += -L$$PWD/ -ljazznovoscreendatasourceINCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/ -
wrote on 9 May 2013, 05:57 last edited by
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?
-
wrote on 9 May 2013, 20:06 last edited by
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??
-
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
-
wrote on 10 Oct 2013, 09:16 last edited by
just use:
@
TEMPLATE = lib
@It will generate .dll under windows and .so under linux or other under other systems
-
wrote on 28 Oct 2013, 15:08 last edited by
[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).