Im having a very strange problem that I can't explain =/
this is what the compiler is saying:
1>------ Build started: Project: 3d, Configuration: Debug Win32 ------
1>Compiling...
1>RENDER.CPP
1>Generating Code...
1>Compiling...
1>GEOM.CPP
1>MAIN.CPP
1>MOVEMENT.CPP
1>Generating Code...
1>Linking...
1>MAIN.obj : error LNK2005: "struct OBJECT * obj" (?obj@@3PAUOBJECT@@A) already defined in GEOM.obj
1>MAIN.obj : error LNK2005: "struct CAMERA camera" (?camera@@3UCAMERA@@A) already defined in GEOM.obj
1>MOVEMENT.obj : error LNK2005: "struct OBJECT * obj" (?obj@@3PAUOBJECT@@A) already defined in GEOM.obj
1>MOVEMENT.obj : error LNK2005: "struct CAMERA camera" (?camera@@3UCAMERA@@A) already defined in GEOM.obj
1>RENDER.obj : error LNK2005: "struct OBJECT * obj" (?obj@@3PAUOBJECT@@A) already defined in GEOM.obj
1>RENDER.obj : error LNK2005: "struct CAMERA camera" (?camera@@3UCAMERA@@A) already defined in GEOM.obj
1>.\Debug/3d.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 9.00.30729
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\Users\Nicolas\Desktop\3DRendering 3\Debug\BuildLog.htm"
1>3d - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This is a link to the code: my appologies for the 30 seconds =(
VS2008
http://rapidshare.com/files/198510158/3D.zip.html
In my project I need to have these two things, available to all the other classes and routines:
CAMERA camera;
OBJECT *obj;
so I put them in a file MAIN.H that is included at the begining of all the other header files for the other classes.
I have put these two objects inside the ifndef tags like this:
#ifndef _MAIN_H
#define _MAIN_H
CAMERA camera;
OBJECT *obj;
#endif
anywho, bottom line is that I need these two things available from anywhere in the project...how can I accomplish this or fix this?
Thanks, Nick