Run qmake and then build your program again. Btw. your class is called "simples" and you are calling the constructor as "simple".
Run qmake and then build your program again. Btw. your class is called "simples" and you are calling the constructor as "simple".
My mistake. The follow problem was detected:
undifined reference to 'simples::simples(QWidget*)'
It's not a problem about compilation I think. I'm using the Qt Creator to do everything, like designer the ui files and compile the program. Is there any problem to do it?
Again, check if you actually implemented the simples constructor.
Yes, it works individually. But not when I call it by mainwindow. All my constructors are correct. I just don't know what to do... I've tried everything... Is it better to make the .pro file in the Qt Command Prompt? If you can run my codes on your pc (try to do it in Qt Creator)...
What "works individually"? The .pro file is not an issue here, the linker can't find the implementation of your constructor. Could you post the contents of the offending method?
I don't know exactly what are you asking for. I'm a beginner. Can I send my files to you by email? Sorry bother you, but it's important... :/
Please post the body of the constructor of class "simples". I hope you know what a constructor is... If not, you should first learn at least basics of C++ before taking on Qt.
I try to search in my files about C++ something connect to constructor class but I don't find a good answer. So, I again ask you with you can give me a example of constructor class. I'm still lost here. The following compile output appear when I run telainicial mainwindow:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\TelaPrincipal.exe debug/main.o debug/telainicial.o debug/moc_telainicial.o -L"f:\QT\2010.02.1\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtOpenGLd4 -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/Users/Luiz Paulo/Documents/TelaPrincipal'
mingw32-make: Leaving directory `C:/Users/Luiz Paulo/Documents/TelaPrincipal'
[r]debug/telainicial.o:C:\Users\Luiz Paulo\Documents\TelaPrincipal/telainicial.cpp:16: undefined reference to `simples::simples(QWidget*)'
debug/telainicial.o: In function `~simples':
C:\Users\Luiz Paulo\Documents\TelaPrincipal/simples.h:7: undefined reference to `vtable for simples'
C:\Users\Luiz Paulo\Documents\TelaPrincipal/simples.h:7: undefined reference to `vtable for simples'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\TelaPrincipal.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project TelaPrincipal
When executing build step 'Make'[/r]
1) run qmake from the menu
2) rebuild your project
3) if it still doesn't work, post simples.h and simples.cpp if they are now different to your first post
It's already posted on top. Can you see? There are 4 codes... 2 of them are this codes...
My bet is you didn't add simples.cpp to SOURCES in your project file. At least I can't see simples.o being linked into the binary.
Can be... now I tried it but the compilation stop to work and when I check the compile output this message was shown:
Running build steps for project TelaPrincipal...
Starting: f:/qt/2010.02.1/qt/bin/qmake.exe C:/Users/Luiz Paulo/Documents/TelaPrincipal/TelaPrincipal.pro -spec win32-g++ -r
c:\Users\Luiz Paulo\Documents\TelaPrincipal\TelaPrincipal.pro:15 : Parse Error ('simples.cpp')
Error processing project file: C:/Users/Luiz Paulo/Documents/TelaPrincipal/TelaPrincipal.pro
Exited with code 3.
Error while building project TelaPrincipal
When executing build step 'QMake'
Just one doubt... Which simples's files have to be in the same folder that the mainwindow's folder? Cause when I made both, I made it individually, so each one have a specific folder. But, I copy and put the simples.h, simples.cpp, ui_simples.h in the mainwindow's folder...
Did you add simples.cpp to the SOURCES variable or did you just put it in the project file in a random place?
You can place the actual files anywhere you want as long as you tell the compiler where to find them.
How I tell the compiler where is the dialog files? Sorry the stupid question... I'm noob about Qt...
Bookmarks