PDA

View Full Version : Need to create a dll



DDHarLiN
7th June 2012, 10:28
I am having quite a bit of trouble trying to compile a c++ file with qmake. I have been given a c++ file and a .pro file to work with. The steps I've followed are as follows:

Open cmd
cd C:\nukePlugins\nukePlugins_\monitorSocket
C:\Qt\4.8.1_x64\qmake\qmake.exe
This creates "debug" and "release" folders as well as "Makefile", "Makefile.Debug" and "Makefile.Release" files. But no dll. What is the next step in this process?

If it helps the contents of the .pro file are below:

# -------------------------------------------------
# Project created by QtCreator 2009-11-12T14:20:23
# -------------------------------------------------

#NDKDIR = C:/Program Files/Nuke6.1v3
NDKDIR = C:/Program Files/Nuke6.1v3

#CONFIG += plugin qdbus
CONFIG += plugin

QT += core \
network \
gui

#DESTDIR = ~/.nuke/
TARGET = monitorSocket

#QMAKE_CXX = g++-4.1
QMAKE_RPATHDIR = /usr/lib

TEMPLATE = lib
DEFINES += USE_GLEW
SOURCES += monitorSocket.cpp
#HEADERS += monitorSocket_global.h

INCLUDEPATH += $$NDKDIR/include

#LIBS += -lDDImage -L$$NDKDIR
LIBS += -L$$NDKDIR

QMAKE_CXXFLAGS += -g

macx:QMAKE_LFLAGS_PLUGIN += -undefined suppress -flat_namespace

unix:QMAKE_POST_LINK = cp libmonitorSocket.so ~/.nuke/monitorSocket.so
macx:QMAKE_POST_LINK = cp libmonitorSocket.dylib ~/.nuke/monitorSocket.dylib
Also I notice below there is a section:

macx:QMAKE_LFLAGS_PLUGIN += -undefined suppress -flat_namespace
unix:QMAKE_POST_LINK = cp libmonitorSocket.so ~/.nuke/monitorSocket.so
macx:QMAKE_POST_LINK = cp libmonitorSocket.dylib ~/.nuke/monitorSocket.dylib
do I need to add something for win32?

I.e win32:QMAKE_POST_LINK = cp libmonitorSocket.dll ~/.nuke/monitorSocket.dll

wysota
7th June 2012, 10:47
You need to run make.

DDHarLiN
7th June 2012, 11:06
Thanks, in cmd in the folder that the files are do I just type "make" and hit enter (tried that and didn't work) or can you please give an example

wysota
7th June 2012, 14:35
http://lmgtfy.com?q=using+make

giorgik
7th June 2012, 18:29
dear DDHarLiN, I imagine that you're under Windows. Which compiler uses Qt (MinGW 4.4 or MSVC++) ?
If like me you use MinGW 4.4, runs the shell command:
START | Programs | Qt by Nokia v4.8.1 (MinGW OpenSource) | Qt 4.8.1 Command Prompt

then go to the directory of your project to be compiled (where the file is present .pro), then type:

qmake && make

DDHarLiN
8th June 2012, 14:13
Thanks Giorgik

Ive done like you have said, this is what the line looks like:

C:\nukeplugins\monitorsocket>qmake && c:\minGW\msys\1.0\make.exe

But then i get this error everytime:

/usr/bin/make -f Makefile.debug
make[1]: Entering directory '/c/nukeplugins/monitorsocket'
Makefile.debug:59: *** missing seperator. Stop.
make[1]: Leaving directory '/c/nukeplugins/monitorsocket'
make: *** [debug] Error 2

wysota
8th June 2012, 20:44
Use mingw32-make as the docs advise.

giorgik
9th June 2012, 14:09
DDHarLiN, you must use the version of MinGW 4.4. For as long as it vai the site:
http://get.qt.nokia.com/misc/MinGW-gcc440_1.zip
Then you have to use the library Qt 4.8.1:
http://releases.qt-project.org/qt4/source/qt-win-opensource-4.8.2-mingw.exe
while the source to compile Qt-Creator 2.5:
http://get.qt.nokia.com/qtcreator/qt-creator-2.5.0-src.zip

yeroosmiler
14th August 2012, 09:30
i have started my basics of Qt, in one my book,
my questio is :

how do i write a program that ask user to enter a number, and then checks weather the number is prime or not.it should use a QInputDialog to get number from the user and QMessage to display the result.

i have created my projects, below is my main.cpp:

#include<QApplication>
#include<QMessageBox>
#include<QInputDialog>

int main( int argc, char **argv )
{
QApplication app(argc, argv);



return 0;
}


and below is .pro


SOURCES += \
Question1.cpp



thank you