POV-Ray : Newsgroups : povray.off-topic : C++ question... : Re: C++ question... Server Time
5 Sep 2024 17:18:24 EDT (-0400)
  Re: C++ question...  
From: JRG
Date: 14 Jun 2009 13:29:57
Message: <4a353395$1@news.povray.org>
Darren New wrote:
> Isn't it legal to put a class declaration in the same .cpp file where 
> you define its member functions and the main() that's the only routine 
> that uses it?
> 
> When I did that, I got errors about not being able to find the vtable 
> for the class.
> 
> Is #include supposed to work just like a textual include? Is this 
> something funky with the Qt preprocessing stuff?
> 

Perfectly legal.

As far as Qt is concerned... are you running moc by yourself?
You known, qmake uses the HEADERS variable to look for Q_OBJECT classes.

If your private class contains that macro, just try and include the 
generated .moc directly.

Something like:

source.cpp:

class my_private_implementation
{
	Q_OBJECT

	/* neat stuff */
};
#include "source.moc"

--

Jonathan.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.