Original Post
Hi everybody, I'm trying to compile the program contained by raytracer1.zip in this tutorial http://www.flipcode....roduction.shtml This program is a Visual C++ program. I imported it in Microsoft Visual C++ 2010 Express and it run but now I would like to compile and run it from Eclipse or line command using gcc compiler from cygwin because I'm more familiar with them.
I'm using a Windows XP system, I've installed Eclipse Indigo C/C++ and Cygwin (gcc, make..., commands) on my computer and I've tried the following command with the following errors:
(command) $ gcc raytracer.cpp -o raytracer.exe
(errors)
In file included from raytracer.h:9,
from raytracer.cpp:6:
common.h:72: error: member Raytracer::vector3 Raytracer::plane::::::N' with constructor not allowed in anonymous aggregate
common.h:72: error: member
raytracer.cpp:96: error: no match for 'operator*' in 'Raytracer::operator*(diff, ((const Raytracer::vector3&)((const Raytracer::vector3*)(&prim->Raytracer::Primitive::GetMaterial()
->Raytracer::Material::GetColor())))) * light->Raytracer::Primitive::GetMaterial()->Raytracer::Material::GetColor()'
common.h:52: note: candidates are: Raytracer::vector3 Raytracer::operator*(const Raytracer::vector3&, float)
common.h:53: note: Raytracer::vector3 Raytracer::operator*(const Raytracer::vector3&, Raytracer::vector3&)
common.h:54: note: Raytracer::vector3 Raytracer::operator*(float, const Raytracer::vector3&)
raytracer.cpp:177:26: warning: no newline at end of file
I've used Eclipse with Cygwin and I've got the same error with an additional one Type 'Sphere' could not be resolved. I have all files in the same directory and Sphere is in scene.h, but it seems as if the scene.cpp file doesn't find scene.h.
I really appreciate any help you can give me. An important thing, I know Java and I use Eclipse to work with it, that's the reason I'm using Eclipse.
I'm using a Windows XP system, I've installed Eclipse Indigo C/C++ and Cygwin (gcc, make..., commands) on my computer and I've tried the following command with the following errors:
(command) $ gcc raytracer.cpp -o raytracer.exe
(errors)
In file included from raytracer.h:9,
from raytracer.cpp:6:
common.h:72: error: member Raytracer::vector3 Raytracer::plane::
common.h:72: error: member
Raytracer::vector3 Raytracer::plane::::::N' with constructor not allowed in union
In file included from raytracer.h:9,
from raytracer.cpp:6:
common.h:83:7: warning: no newline at end of file
In file included from raytracer.cpp:6:
raytracer.h:57:7: warning: no newline at end of file
In file included from raytracer.cpp:7:
scene.h:124:7: warning: no newline at end of file
raytracer.cpp: In member function Raytracer::Primitive* Raytracer::Engine::Raytrace(Raytracer::Ray&, Raytracer::Color&, int, float, float&)':raytracer.cpp:96: error: no match for 'operator*' in 'Raytracer::operator*(diff, ((const Raytracer::vector3&)((const Raytracer::vector3*)(&prim->Raytracer::Primitive::GetMaterial()
->Raytracer::Material::GetColor())))) * light->Raytracer::Primitive::GetMaterial()->Raytracer::Material::GetColor()'
common.h:52: note: candidates are: Raytracer::vector3 Raytracer::operator*(const Raytracer::vector3&, float)
common.h:53: note: Raytracer::vector3 Raytracer::operator*(const Raytracer::vector3&, Raytracer::vector3&)
common.h:54: note: Raytracer::vector3 Raytracer::operator*(float, const Raytracer::vector3&)
raytracer.cpp:177:26: warning: no newline at end of file
I've used Eclipse with Cygwin and I've got the same error with an additional one Type 'Sphere' could not be resolved. I have all files in the same directory and Sphere is in scene.h, but it seems as if the scene.cpp file doesn't find scene.h.
I really appreciate any help you can give me. An important thing, I know Java and I use Eclipse to work with it, that's the reason I'm using Eclipse.