Author Topic: another qt question  (Read 3827 times)

Offline coderunner

  • Single posting newcomer
  • *
  • Posts: 4
another qt question
« on: April 22, 2006, 07:33:29 pm »
I'm using cb to work on my qt programs in windows and the interface is very effective.  But, i can't compile my programs that use signals/slots in qt.  From what I read searching the forums, this is because qt doesn't automatically handle the moc.exe call to generate the necessary .cpp files.  I tried setting up my project to use the custom makefile that qmake produces but this also doesn't seem to work.  I was hoping that by telling cb to use the custom makefile, the mingw-make would just call the Makefile, and all would be fine. 

Does someone know if cb is not able to successfully use the custom makefile made by qmake or am I doing something wrong on my end personally?  Thanks in advance.

I am also using the old 1.0rc2 version if that helps.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: another qt question
« Reply #1 on: April 22, 2006, 07:52:35 pm »
Using RC2 certainly doen't help, here's a good alternative. Anyway, can you say what errors you got? The automatic generation of .pro files is limited to simple programs only, I suggest you write your own and run qmake on your custom project file to generate a Makefile. If you don't know how to do this, then the Qt docs can help you. If you have a valid Makefile that you can use to build your project and Code::Blocks refuses to use it then someone here will help.
Life would be so much easier if we could just look at the source code.

Offline coderunner

  • Single posting newcomer
  • *
  • Posts: 4
Re: another qt question
« Reply #2 on: April 22, 2006, 08:31:37 pm »
Here is the error message I get when using just codeblocks compile:

Linking executable: QtGL.exe
.objs\MyGLWidget.o:MyGLWidget.cpp:(.text+0x13d): undefined reference to `vtable for MyGLWidget'
.objs\MyGLWidget.o:MyGLWidget.cpp:(.text+0x149): undefined reference to `vtable for MyGLWidget'
.objs\MyGLWidget.o:MyGLWidget.cpp:(.text+0x18f): undefined reference to `vtable for MyGLWidget'
.objs\MyGLWidget.o:MyGLWidget.cpp:(.text+0x19b): undefined reference to `vtable for MyGLWidget'
.objs\MyGLWidget.o:MyGLWidget.cpp:(.text+0x1ad): undefined reference to `vtable for MyGLWidget'
.objs\MyGLWidget.o:MyGLWidget.cpp:(.text+0x1b9): more undefined references to `vtable for MyGLWidget' follow
collect2: ld returned 1 exit status

I am trying to connect a timer signal to my updateGL slot.

I will try the nightly builds with custom makefile and post that.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: another qt question
« Reply #3 on: April 22, 2006, 08:44:55 pm »
This is a typical error message and it means that you have to run qmake again and make sure that in the HEADERS section of your .pro file you see MyGLWidget.h. If you google your error message you 'll find tons of info. This has nothing to do with the C::B version you're using. If you get the latest C::B sources and manage to build it yourself (it's not that hard), then you 'll be able to use this as well.
« Last Edit: April 22, 2006, 08:48:24 pm by yop »
Life would be so much easier if we could just look at the source code.

Offline coderunner

  • Single posting newcomer
  • *
  • Posts: 4
Re: another qt question
« Reply #4 on: April 22, 2006, 08:51:00 pm »
Oh man, thanks yop.  Lol, I found your post earlier when I searched for qt problems on the forums where you mentioned possibly making a plugin.  However, I couldn't ever find the actual post so I figured you couldn't find the time to make one.  I will try out your plugin.

Edit:  Oops, spoke too soon.  I'd have to build my own cb to add the plug-in in.  I'll try the custom makefile method first so I can start working on my other qt projects right away.  If only I didn't get rid of my wxwidgets dev. env.
« Last Edit: April 22, 2006, 08:53:47 pm by coderunner »

Offline coderunner

  • Single posting newcomer
  • *
  • Posts: 4
Re: another qt question
« Reply #5 on: April 22, 2006, 09:10:21 pm »
Got the custom makefile to work with the nightly cb build.  Thanks for your help yop.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: another qt question
« Reply #6 on: April 22, 2006, 10:25:05 pm »
You 're welcome, I 'm glad I could help.
Life would be so much easier if we could just look at the source code.