Error compiling: No viable overloaded '='

2,737 views
Skip to first unread message

Roberto Vergallo

unread,
May 12, 2012, 7:40:25 AM5/12/12
to g3d-...@googlegroups.com
Hi,
I've downloaded and installed G3D 9.0 b03 on My MacOSX 10.7.
I've putted the G3D folder in my home directory, then I've set the PATH, G3D9DATA, LIB and INCLUDE variable in my .profile file ($LIB and $INCLUDE were not present).
I've trying to run the rawOpenGL sample in my XCode 4, but I get the following compile error in file Component.h: No viable overloaded '='
Can you help me solving the problem?
Thanks,
Roberto

Roberto Vergallo

unread,
May 12, 2012, 1:43:08 PM5/12/12
to g3d-...@googlegroups.com
The error refers to the following piece of code:

    static void convert(const Color4& c, Color1& v) {
         v = c.r; //the error is here
    }

Thanks.

Morgan McGuire

unread,
May 12, 2012, 2:43:05 PM5/12/12
to g3d-...@googlegroups.com
Do this:

v = Color1(c.r)

or

v.value = c.r;

If float silently cast to Color1 it could lead to accidental type
errors elsewhere, so we disallow it.

-m

Prof. Morgan McGuire
Computer Science Department
Williams College
http://cs.williams.edu/~morgan
Reply all
Reply to author
Forward
0 new messages