Jump to content
  • Advertisement
Sign in to follow this  
EDBarrera

Eclipse, Cygwin, Raytracer tutorial

This topic is 2603 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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::<anonymous union>::<anonymous struct>::N' with constructor not allowed in anonymous aggregate
common.h:72: error: member `Raytracer::vector3 Raytracer::plane::<anonymous union>::<anonymous struct>::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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!