Tuesday, 20 November 2007

Undefined reference, something to do with signals and moc

I'm using KDevelop in KDE to write a QT4 app and added a signal to my class. When I built the project and rebuilt it it came up with an undefined reference error even though my syntax was correct. I found out it was something to do with the meta-object compiler (moc) which creates code to handle the signals and slots.
First thing was I needed to add the Q_OBJECT macro to the start of the class declaration in my .h file. This would be OK but after building it still produced the error and I was extremely confused. A little searching on the web and it said that I would need to run "tmake" to parse my project files and notice the newly added Q_OBJECT macro, it also helpfully mentioned that it is automatically run when the project file is changed so I opened my project.pro file, changed a letter and changed it back to mark it as modified, press build, selected to reload the 'modified' project file and tmake worked its magic and made my project build. Sweet - better than manually adding all the moc entries as I did before!!

Thursday, 15 November 2007

Graphics don't work in real-time kernel

I'm now running Kubuntu Linux version 7.10 - Gutsy Gibbon and when I rebooted into the real time kernel to do some music recording, the graphics didn't work and I got a terminal window instead of an X login screen. I looked into the whole building specific NVidia drivers like I had to in 7.04 Feisty Fawn but stopped when it seemed like a messy fix. I surfed the web and found that I should have installed the linux-restricted-modules-rt package. For some reason, the normal one is installed by default but the real time kernel doesn't seem to pull in the real time flavour. Have installed it now and expect it to work sweet!! The package says what drivers it includes.