Wednesday 2 December 2009

C++ errors

A list of annoying C++ compilation errors and how I finally resolved them:


(1)
...undefined reference to `typeinfo...
or
...Undefined reference to vtable

Solution: A base class from which classes are derived contains virtual function(s) but they are missing null bodies.

e.g.
virtual float getvalue() ;
should read:
virtual float getvalue() {} ;




(2) error: passing `const Quat' as `this' argument of `Quat& Quat::operator=(const Quat&)' discards qualifiers


Solution: A "const" type cannot be changed. I was attempting to assign a value to a const type. Created a new variable of same type (but not const).


(3) error: aggregate ‘std::stringstream ss’ has incomplete type and cannot be defined
or
error: X has incomplete type

Usually this refers to STD::X objects.
You've included but you need to include or
for files (ifstream/ofstream) and stringbuffers.



[to be continued]

Thursday 28 May 2009

PhotoSynth for all!

Microsoft have released Photosynth for public use, so you can now create your own walk-through environments, just by providing multiple photos of the scene. The interface needs a bit of improvement but it's easy enough to use. Here's a few initial tests I did...

Allegheny National Park

Niagara Falls