Thread: What headers am I missing? Where do I get them?

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968

    What headers am I missing? Where do I get them?

    Curiously, when I do include these
    Code:
    #include	"Vector3D.h"
    #include	"Vector.h"
    #include	<vector>
    they aren't found, but for some reason, The Vector3 data type is being undeclared, whats the deal?

    Code:
    #ifndef	GL_RENDERER_H
    #define	GL_RENDERER_H
    
    #include	<vector>
    
    using namespace std;
    
    struct	BasicQuad
    {
    	Vector3 P1, P2, P3, P4;
    	int	Texture;//Index into gpTextureManager
    };
    	std::vector<BasicQuad*>			mBasicQuads;
    class GLRenderer
    {
    public:
    	GLRenderer()
    	{
    
    	}
    
    	
    	void	AddBasicQuadToRenderer(float	P1X,float	P1Y,float	P1Z,
    								  float	P2X,float	P2Y,float	P2Z,
    								  float	P3X,float	P3Y,float	P3Z,
    								  float	P4X,float	P4Y,float	P4Z,
    								  int	Texture)
    	{
    		BasicQuad	*pData = new	BasicQuad;
    		pData->P1	=	Vector3(P1X,P1Y,P1Z);
    		pData->P2	=	Vector3(P2X,P2Y,P2Z);
    		pData->P3	=	Vector3(P3X,P3Y,P3Z);
    		pData->P4	=	Vector3(P4X,P4Y,P4Z);
    		pData->Texture	=	Texture;
    		mBasicQuads.push_back(pData);
    	}
    };
    
    
    
    #endif
    Last edited by Shamino; 11-23-2005 at 10:39 AM.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    well, I can't find any standard definitions of vector3 anywhere... the only references I can find are proprietary templates or wrappers created either by a third-party library, or by you.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    What graphics library are you using? Do you have the "correct" compiler or graphics library for which this code was written?

    <vector> is included in standard C++, the others are not. And, FYI <vector> has nothing to do with graphics. (There are no graphics in standard C++.) An STL vector is variable-length array.

  4. #4
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    Maybe there is another library file i need? Perhaps its part of SDL....

    Is there anything I could use in its place? like a float? or something simple like that?
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  5. #5
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    Well...when I encounter similar problems in unix, I search for the pattern lets say Vector3 in the "/usr/include" directory and then find the appropriate header. It may also so happen that vector.h is in a different directory like for example "#include <sys/vector.h>"

    ....does this help?

  6. #6
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    I'm basing my code off of a friend, he is probably using some type of specialized vector library, I'll ask him...
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  7. #7
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    fixed it, just made my own vector3 class :d

    Code:
    class Vector3
    {
    public:
     
      Vector3()
      {
      }
    
      Vector3(float x, float y, float z);
    
    // And so on
    };
    works perfectly
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  3. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM