Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Eclipse, Cygwin, Raytracer tutorial

Started by EDBarrera Oct 19, 2011 at 2:49 AM 1 replies 1.5k views
Original Post
EDBarrera
EDBarrera
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::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.
ApochPiQ
ApochPiQ
The first problem is down to VC++ allowing non-standard code constructs which are forbidden in gcc. There might be an option to enable them in gcc using an extension, but I don't know offhand.

The other problem sounds like you might just have a mistake in your makefile/project settings. Hard to say for sure without seeing how you converted over to using gcc.
EDBarrera
EDBarrera
Hi ApochPiQ, you are right, I had some problems trying to import from CV++ to Eclipse. I decided to investigate the code with VC++, and I could implement my version in Java using Eclipse. Thank you for your help.

Daniel.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.