Re: Can't Compile Tutorial 7
Right...
I need to be in command prompt and go
qmake -project
qmake
make
But how can I get code::blocks to do that when I click compile?
1 Attachment(s)
Re: Can't Compile Tutorial 7
Ok, try this.
Do this once:
- Unzip the attachement to %HOMEPATH%\.Codeblocks
- Restart Codeblocks
- Menu > Settings > Compiler
- Select Other tab
- Set Build method to Work with Makefiles (GNU "make" required)
- (Optional) Set Logging to Full command line
- Menu > Tools > Configure tools...
- Add the first tool
- Add
- Name: Create QT Project file
- Executable: Path to qmake.exe
- Parameters: -o Makefile
- Working directory: ${PROJECT_DIR}
- Ok
- Add the second tool
- Add
- Name: Create Makefile
- Executable: Path to qmake.exe
- Parameters: leave empty
- Working directory: ${PROJECT_DIR}
- Ok
For each of your new QT Projects do the following:
- Menu > File > New Project...
- Select User Templates tab
- Choose Cesar's QT Application
- After adding new *.cpp, *.h files don't forget to
- Menu > Tools > Create QT Project file
- Menu > Tools > Create Makefile
Re: Can't Compile Tutorial 7
Some more comments:
The name of the template depends on the name of the directory, which contains the *.cbp project template. In this case it is "Cesar's QT Application". You might want change it to something reasonable :).
The *.cbp file is plain XML file so it could be edited manually.
Now I'm looking for the fine way to include diferent QT modules while building the *.pro file. For now, you should change the Tool "Create QT Project file" and add QT+="sql network" to the options, to make use of sql and network modules respectively... Any ideas how to improove this approach?
Re: Can't Compile Tutorial 7
Would you care giving this a try? Still pre-alpha I'm afraid but I'm working on it ;)
Re: Can't Compile Tutorial 7
Still can't compile 7 or 8...
:(
Re: Can't Compile Tutorial 7
Could you, please, post something more informative? Any compilation/linking errors, the steps you've done to achive them, etc. Your post gives no information about the reason of your problem.
Re: Can't Compile Tutorial 7
Sorry :)
Well, the results are still the same as it were earlier. So nothing's changed.
On both the projects.
But I could redo them from scratch again (using your Code::Blocks template, and check if they run again). But I don't have time for the next while...
-Reenen
Re: Can't Compile Tutorial 7
That's ok, keep trying, when you find some spare time :)
But keep in mind, that qmake -project scans the current directory, all its sub-directories and adds the files it found to the project file. So all the *.o files left from the previous compilation attempts will occasionally get to the resulting Makefile. This may lead to broken dependencies, etc, etc...
Re: Can't Compile Tutorial 7
Did you remember to add the Q_OBJECT macro to the class definition?
Did you split the class into two files (header and implementation)?
Re: Can't Compile Tutorial 7
Yes, I did add the Q_OBJECT macro thingy to the file. But I haven't "rebooted" the whole application and restarted from scratch. :)
I'll do that when time permits.