Creation of .dll file using build option in Qt-Creator
-
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
-
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/ -
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
-
[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).