Solved Stickman copy paste Error
-
Hello everyone,
I am new at QT programming.
I copy the Stickman example and get errors.15:52:44: Running steps for project stickman...
15:52:44: Configuration unchanged, skipping qmake step.
15:52:44: Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/klechner/Documents/build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
Makefile.Debug:129: warning: overriding recipe for target 'debug/qrc_stickman.cpp'
Makefile.Debug:126: warning: ignoring old recipe for target 'debug/qrc_stickman.cpp'
Makefile.Debug:615: warning: overriding recipe for target 'debug/moc_stickman.cpp'
Makefile.Debug:224: warning: ignoring old recipe for target 'debug/moc_stickman.cpp'
Makefile.Debug:2160: warning: overriding recipe for target 'debug/stickman.o'
Makefile.Debug:1200: warning: ignoring old recipe for target 'debug/stickman.o'
C:\Qt\5.6\mingw49_32\bin\rcc.exe -name stickman ..\stickman\stickman.qrc -o debug\qrc_stickman.cpp
RCC: Error in '..\stickman\stickman.qrc': Cannot find file 'animations/chilling.bin'Makefile.Debug:129: recipe for target 'debug/qrc_stickman.cpp' failed
mingw32-make[1]: *** [debug/qrc_stickman.cpp] Error 1
mingw32-make: *** [debug] Error 2
mingw32-make[1]: Leaving directory 'C:/Users/klechner/Documents/build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
15:52:46: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project stickman (kit: Desktop Qt 5.6.0 MinGW 32bit)
When executing step "Make"
15:52:46: Elapsed time: 00:02.Thank you for your help.
-
hi and welcome
it seems you didn't copy it res file
stickman.qrc': Cannot find file 'animations/chilling.bin
so copy the subfolder also (animations) -
Hello, Thanks I create the qrp again and now this problem should be solved.
Now there are other problems.I create the Project out of here:
http://doc.qt.io/qt-5/qtwidgets-animation-stickman-example.htmlNow there are a lot of multiple definition of '' Errors in Stickman.cpp.
On every Funktion with Stickman::...Thank you very much
-
Hi,
What exact errors are you getting ?
-
hi
Very hard to guess what that could be since we dont know what you did.If you just copied the project, that should not happen.
Can you show one of the errors as it reads? (you can right click an copy)
-
./debug\Stickman.o: In function
ZSt4moveIRP15QPlatformPixmapEONSt16remove_referenceIT_E4typeEOS4_': C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:114: multiple definition of
StickMan::StickMan()'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:114: first defined here
./debug\Stickman.o: In functionZSt4moveIRP15QPlatformPixmapEONSt16remove_referenceIT_E4typeEOS4_': C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:114: multiple definition of
StickMan::StickMan()'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:114: first defined here
./debug\Stickman.o: In functionZN8StickManD2Ev': Makefile.Debug:97: recipe for target 'debug\stickman.exe' failed C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:142: multiple definition of
StickMan::~StickMan()'
mingw32-make[1]: Leaving directory 'C:/Users/klechner/Documents/build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:142: first defined here
./debug\Stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:59: multiple definition ofnon-virtual thunk to StickMan::~StickMan()' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:59: first defined here ./debug\Stickman.o: In function
ZN8StickManD2Ev':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:142: multiple definition ofStickMan::~StickMan()' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:142: first defined here ./debug\Stickman.o: In function
ZN8StickManD0Ev':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:142: multiple definition ofStickMan::~StickMan()' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:142: first defined here ./debug\Stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:59: multiple definition of
non-virtual thunk to StickMan::~StickMan()'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:59: first defined here
./debug\Stickman.o: In functionZN8StickMan20childPositionChangedEv': C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:147: multiple definition of
StickMan::childPositionChanged()'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:147: first defined here
./debug\Stickman.o: In functionZN8StickMan13setDrawSticksEb': C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:152: multiple definition of
StickMan::setDrawSticks(bool)'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:152: first defined here
./debug\Stickman.o: In functionZNK8StickMan12boundingRectEv': C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:161: multiple definition of
StickMan::boundingRect() const'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:161: first defined here
./debug\Stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:61: multiple definition ofnon-virtual thunk to StickMan::boundingRect() const' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:61: first defined here ./debug\Stickman.o: In function
ZNK8StickMan9nodeCountEv':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:167: multiple definition ofStickMan::nodeCount() const' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:167: first defined here ./debug\Stickman.o: In function
ZNK8StickMan4nodeEi':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:172: multiple definition ofStickMan::node(int) const' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:172: first defined here ./debug\Stickman.o: In function
ZN8StickMan10timerEventEP11QTimerEvent':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:180: multiple definition ofStickMan::timerEvent(QTimerEvent*)' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:180: first defined here ./debug\Stickman.o: In function
ZN8StickMan9stabilizeEv':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:185: multiple definition ofStickMan::stabilize()' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:185: first defined here ./debug\Stickman.o: In function
ZNK8StickMan6posForEi':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:214: multiple definition ofStickMan::posFor(int) const' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:214: first defined here ./debug\Stickman.o: In function
ZN8StickMan5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget':
C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:220: multiple definition ofStickMan::paint(QPainter*, QStyleOptionGraphicsItem const*, QWidget*)' ./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/Stickman.cpp:220: first defined here ./debug\Stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:62: multiple definition of
non-virtual thunk to StickMan::paint(QPainter*, QStyleOptionGraphicsItem const*, QWidget*)'
./debug\stickman.o:C:\Users\klechner\Documents\build-stickman-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../stickman/stickman.h:62: first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [debug\stickman.exe] Error 1
mingw32-make: *** [debug] Error 2
07:53:28: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project stickman (kit: Desktop Qt 5.6.0 MinGW 32bit)
When executing step "Make"I only create the Files and copy the code from the webside. I only wanted to get a little bit in the topic.
I am not as bad as it looks like. I program now on C#.
But the first time at a new Program is allways hard.Thanks
-
Hi
Ahh, u copy from website.
In creator, if u press the
Welcome
then
Examples
then type stick in search field, the example should be
there , ready to run :) -
:D OK! My fault.
Yes this is working.
But what is the Problem with the copied one?
Thanks
-
Hi, not really sure.
Normally it dont explode like that :)Somehow its defined more than one time. like if u first pasted to
one file and then a new one and both be included.But im pretty sure u did not do that :)
The error does say where it seen it first so you can click around and see why there is 2. -
Ok thanks!
Maybe i find it.
The Exampels are working fine.Thank you very much!
-
@Revelator
Np. welcome to Qt. :)
Have fun.