Qt Error 1
Contents |
download a browser that supports debug/moc_mainwindow.cpp error 1 JavaScript, or enable it if it's disabled (i.e. NoScript). Home Qt Development General and Desktop [Solved] error: [debug/moc_mainwindow.cpp] Error 1 [Solved] error: [debug/moc_mainwindow.cpp] Error 1 This topic has been deleted. Only users with topic management privileges can see it. szh1 last edited by I am getting an error: [debug/moc_mainwindow.cpp] Error 1 Here is the output from the "Compile Output" tab: Running build steps for project ExtremeImageConverter... Starting: "c:/qt/2010.05/qt/bin/qmake.exe" C:/My Dropbox/Extreme Image Converter/Extreme Image Converter/ExtremeImageConverter.pro -r -spec win32-g++ The process "c:/qt/2010.05/qt/bin/qmake.exe" exited normally. Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w mingw32-make: Entering directory `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop' C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop' c:\Qt\2010.05\qt\bin\uic.exe "..\Extreme Image Converter\mainwindow.ui" -o ui_mainwindow.h g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"......\Qt\2010.05\qt\include\QtCore" -I"......\Qt\2010.05\qt\include\QtGui" -I"......\Qt\2010.05\qt\include" -I"......\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Extreme Image Converter" -I"." -I"......\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\main.o "..\Extreme Image Converter\main.cpp" g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"......\Qt\2010.05\qt\include\QtCore" -I"......\Qt\2010.05\qt\include\QtGui" -I"......\Qt\2010.05\qt\include" -I"......\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Extreme Image Converter" -I"." -I"......\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\mainwindow.o "..\Extreme Ima
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Qt compiling error 1 up vote 2 down vote favorite When i try to compile my program i get this error: [tmp/moc/debug_shared/moc_window.cpp] Error 1 I have a class called https://forum.qt.io/topic/1699/solved-error-debug-moc_mainwindow-cpp-error-1 Window. when I comment the Q_OBJECT line it compiles, but I can't use any slots. class Window : public QWidget { // Q_OBJECT public: Window(); public slots: void update(); }; I have QT 4.7 installed. Any Idea why it doesn't compile when I uncomment the Q_OBJECT line? Thanks for any help. c++ qt4 share|improve this question edited Jan 17 '11 at 7:11 asked Jan 17 '11 at 6:45 Mustafa 320517 Oh I forgot to write that http://stackoverflow.com/questions/4710636/qt-compiling-error-1 my class Window is a subclass of QWidget –Mustafa Jan 17 '11 at 7:11 1 Please post the whole error message, not just the last line. –kalev Jan 17 '11 at 8:50 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote You have a slot so you must have the Q_OBJECT macro, after adding this do a clean build. And in case of an error, post the whole error log not the last line. share|improve this answer answered Jan 17 '11 at 8:47 ismail 26.5k55476 add a comment| up vote 0 down vote maybe something is wrong with Moc paths... make sure that you have write rights in folder you use for moc-ing qt headers. ( tmp/moc/debug_shared/ ). And I don't know this extractly for linux, but on windows directory where you generating moc files must exist. share|improve this answer answered Jan 17 '11 at 8:45 Raiv 4,20912244 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged c++ qt4 or ask your own question. asked 5 years ago v
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn http://stackoverflow.com/questions/15308440/qt-mingw32-build-error-debug-rasterwindow-o-error-1 more about Stack Overflow the company Business Learn more about hiring developers or http://stackoverflow.com/questions/21653787/release-compile-problems-qt-c posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Qt mingw32 build Error [debug/rasterwindow.o] Error 1 up vote 0 error 1 down vote favorite I installed Qt 5.0.1 mingw 4.7, when I build/run an example, I got this at issues: and this at Compile Output: I can't build/run anything. How to fix that? Thanks. qt build-error share|improve this question asked Mar 9 '13 at 7:39 egig 2,92031029 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote This was worked for me Projects > Build qt error 1 > Build Environment: Check the Clear System environment follow the following link for more answers stackoverflow.com/qt-error-2-at-compile-time share|improve this answer answered Nov 26 '15 at 14:01 TharinduKetipe 2211 add a comment| up vote 0 down vote Have you set your PATH correctly within your System Environment Variables? Path Variables I have set for Qt: QTDIR: D:\Qt\Qt5.0.1\5.0.1\mingw47_32 Path: C:\Ruby200-x64\bin;C:\Python33\;C:\Perl64\site\bin;D:\Qt\Qt5.0.1\Tools\MinGW\bin;xxx;D:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin; ** Note: I have read before that ordering can matter. Ensure you have your Qt bin path after your MinGW bin path. Refer to these discussions: Similar Issue: Case 1 If you were able to run programs in previous versions, but cannot now - try this: Clean project Close QtCreator Remove Release/Debug Folder from app directory Delete xxx.pro.user file (lives in app directory) Manually delete Makefile, Makefile.Debug, Makefile.Release (If still there) Open Qt Creator again and open your project. It should now be asking you to reconfigure your project build settings. Good Luck! share|improve this answer answered Mar 14 '13 at 2:17 Alex Hendren 971112 add a comment| up vote 0 down vote There are some other issues too. This error is mostly occurred the situations when you run your code one time and again trying to run it without closing the previously generated wiza
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Release Compile Problems Qt C++ up vote 1 down vote favorite Whenever I compile my program in debug mode it works perfectly fine, however when I compile it in Release mode I get the following errors: moc_mainwindow.cpp:-1: error: undefined reference to `MainWindow::lowercase(QString)' moc_mainwindow.cpp:-1: error: undefined reference to `MainWindow::on_label_linkActivated(QString const&)' moc_mainwindow.cpp:-1: error: undefined reference to `MainWindow::on_ReadButton_clicked()' :-1: error: release/moc_mainwindow.o: bad reloc address 0x4 in section `.data' collect2.exe:-1: error: error: ld returned 1 exit status The undefined error's are all pointing to functions I deleted in my program. I also "Ctrl-F"ed all of them in the moc_mainwindow.cpp and I couldn't find any of the functions. In addition usually when I double click the errors I usually get a reference showing where the error is in the code but it just says "File not found: moc_mainwindow.cpp" c++ qt share|improve this question edited Feb 9 '14 at 1:11 asked Feb 9 '14 at 0:52 user3183586 87211 Are you performing a clean build? –Vinícius Gobbo A. de Oliveira Feb 9 '14 at 1:51 A clean build? Sorry im pretty new to QT –user3183586 Feb 9 '14 at 1:54 If you are using Qt on Windows and QtCreator, delete the build-* directories and simply press CTRL+B again. This will force QtCreator to generate again all the makefiles and compile all the objects, since they no longer exists. –Vinícius Gobbo A. de Oliveira Feb 9 '14 at 1:55 Please, add ".h file" and ".cpp file" in your "QUESTION". Note moc_mainwindow.cpp is automatically generated. –Guilherme Nascimento Feb 9 '14 at 2:01 Vin