First point: I'm not a C++ expert, far from it. I glanced at it briefly almost a year ago and have not touched again until about 2 weeks ago when I decided to teach myself DirectX in C++. I have had my fair share of errors but have (for the most part) been able to solve them myself. I give up on this one though. As far as I can tell the problem resides in how I am using the .h and .cpp files of the mapCube class, so I will post those.
The errors themselves are few but infuriating: I get a LINK:2019 unresolved external symbol error regarding all the functions of mapCube except the constructors, it tells me they are referenced in the main program but claims they are not initialized. The second error I know of has to do with the checkColl function, in that function alone VC++ 2010 decides that x, y, and z are no longer a part of the mapCube class, it is rather perplexing.
The code:
mapCube.h
#include <d3d9.h>
#include <d3dx9.h>
#include <dinput.h>
extern const float TILE_WIDTH, TILE_HEIGHT;
extern LPDIRECT3DDEVICE9 d3ddev;
// include the Direct3D Library files
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")
#ifndef MAPCUBE_H
#define MAPCUBE_H
class mapCube{
struct CUSTOMVERTEX {FLOAT X, Y, Z; D3DVECTOR NORMAL; DWORD COLOR;}; //might be able to put these elsewhere
#define CUSTOMFVF (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE) //they are already in main, but mapCube needs them too
public:
LPD3DXMESH cubeMesh;
float x,y,z;
void setCoord(float, float, float);
D3DXVECTOR3 getCoord(){return D3DXVECTOR3(x,y,z);};
mapCube();
mapCube(float, float, float);
mapCube(float, float, float, D3DXCOLOR);
void draw(D3DXMATRIX);
void setColor(D3DXCOLOR);
int checkColl(D3DXVECTOR3, D3DXVECTOR3);
};
#endif
mapCube.cpp
#include "mapCube.h"
mapCube::mapCube()
{
x=0;
y=0;
z=0;
setColor(D3DCOLOR_XRGB(128,128,128));
}
mapCube::mapCube(float nx, float ny, float nz)
{
x=nx;
y=ny;
z=nz;
setColor(D3DCOLOR_XRGB(128,128,128));
}
mapCube::mapCube(float nx, float ny, float nz, D3DXCOLOR color)
{
x=nx;
y=ny;
z=nz;
setColor(color);
}
void mapCube::setCoord(float nx, float ny, float nz) //this function and the next one are both called
{ //when the cube is created because I'm using
x=nx; //an array of cubes instead of one-by-one
y=ny;
z=nz;
};
void mapCube::setColor(D3DXCOLOR color) //basically just colors each vertex 'color'
{
LPD3DXMESH tmpMesh=NULL;
D3DXCreateBox(d3ddev, TILE_WIDTH, TILE_HEIGHT, TILE_WIDTH, &tmpMesh, NULL);
tmpMesh->CloneMeshFVF( 0, CUSTOMFVF, d3ddev, &cubeMesh );
LPDIRECT3DVERTEXBUFFER9 tmpVertBuf=NULL;
if( SUCCEEDED(cubeMesh->GetVertexBuffer(&tmpVertBuf)))
{
int nNumVerts = cubeMesh->GetNumVertices();
CUSTOMVERTEX *pVertices = NULL;
tmpVertBuf->Lock( 0, 0, (void**)&pVertices, 0 );
{
int i=0;
while(i<nNumVerts)
{
pVertices[i].COLOR=color;
i++;
}
}
tmpVertBuf->Unlock();
tmpVertBuf->Release();
}
};
void mapCube::draw(D3DXMATRIX matWorld)
{
D3DXMATRIX matTranslate;
D3DXMatrixTranslation(&matTranslate,x,y,z); //translation to the cubes stored coordinates
d3ddev->SetTransform(D3DTS_WORLD, &(matTranslate * matWorld)); //...combined with the total world transform
cubeMesh->DrawSubset(0);
};
int checkColl(D3DXVECTOR3 vecTest, D3DXVECTOR3 vecThis) //2nd arg bc compiler decided to forget
{ //that this class has x,y,z vars
if(vecTest.x>=vecThis.x-(TILE_WIDTH/2.0f) || vecTest.x<=vecThis.x+(TILE_WIDTH/2.0f)) //rudimentary attempt at collision checking
{
return 1;
}
else if(vecTest.z>=vecThis.z-(TILE_HEIGHT/2.0f) || vecTest.z<=vecThis.z+(TILE_HEIGHT/2.0f))
{
return 2;
}
else
{
return 0;
}
}
Sorry if the formatting is a bit off, this is the first time I have used this interface. The compiler reports no syntax errors or otherwise, after I change the x/z references in the last function to a passed D3D vector anyway. Any help/criticism is welcome, whether it relates to d3d or c++. I didn't post the main source because I do not believe the problem is there, but if asked I will post it as well.
Following the solution of that problem, I now notice this warning:
1>Debug\mapCube.obj : warning LNK4042: object specified more than once; extras ignored
I removed the duplicate definitions of CUSTOMVERTEX and FVF and made them extern in the header, but am unable to resolve these problems.
Perhaps you forgot to add mapCube.cpp to your VC++ project. Add this line to the top of mapCube.cpp:
#error This file is indeed being compiled
If that line does not generate a compiler error, then mapCube.cpp is not being compiled.
Try Rebuild Solution. Sometimes things get out of sync, and you just have to recompile everything from scratch.
Just thought it is worth pointing to the bleeding obvious, but is mapCube.cpp included in your project?
The second issue is easily solved: the checkColl implementation (in mapCube.cpp) is missing its mapCube:: prefix. This causes the compiler to think it is a "free function", not a member function of mapCube.
Related
I am trying to learn C++. Presently I am following a book called “Object Oriented Programing in C++” fourth edition (by Robert Lafore). In this book on page number 225 there is an example about object and classes. I have share the example below, and have manage to download included files and extracted them in to the project folder.
So now my project file is contains a file called “msoftcon.c ” and “msoftcon.h”. When I try to compile the project I get an error “undefined reference to ‘init_graphics()’ ”, whereas this function is very much in msoftcon.c.
Example is as follow:
#include <iostream>
#include "msoftcon.h"
using namespace std;
class circle
{
protected:
int xCo, Yco; //coordinates of center
int radius;
color fillcolor; //color
fstyle fillstyle; //fill pattern
public:
void set(int x, int y, int r, color fc, fstyle fs)
{
xCo = x;
Yco = y;
radius = r;
fillcolor = fc;
fillstyle = fs;
}
void draw()
{
set_color(fillcolor); //set color
set_fill_style(fillstyle); //set till
draw_circle(xCo, Yco, radius); //draw solid circle
}
};
int main()
{
init_graphics();
return 0;
}
Most likely you failed to add msoftcon.c and the associated .h to your project. Merely unpacking it in your project directly is not enough. It needs to be actually added to the project, after which it will be compiled and linked with the other files, hopefully eliminating the error you are seeing.
Exactly how that is done depends on your setup (IDE etc.).
I'm Working on a project in c++, but I am native to Java and have little c++ experience. the error i am having is that Cell and CellRenderer both include each other, but I have no idea how to fix this, as they both use one another. if I remove the #include, I get errors with cell, but if I keep it the errors disappear except for the Cell includes itself. This is my code:
#include <string>
#include <iostream>
#include <allegro5\allegro.h>
#include "Cell.h"
#include "Renderer.h"
using namespace std;
class CellRenderer: public Renderer{
Cell * cell;
ALLEGRO_BITMAP * image;
public:
CellRenderer(Cell * c)
{
cell = c;
image = cell->getImage();
}
void render(int x, int y)
{
al_draw_tinted_scaled_bitmap(image, cell->getColor(),0,0,al_get_bitmap_width(image),al_get_bitmap_height(image),x-cell->getRadius(),y-cell->getRadius(),cell->getRadius()*2,cell->getRadius()*2,0);
}
bool doesRender(int x, int y, int wid, int ht)
{
int cellX = cell->getX();
int cellY = cell->getY();
int radius = cell->getRadius();
return cellX>x-radius&&cellX<x+wid+radius&&cellY>y-radius&&cellY<y+ht+radius;
}
}
class Cell{
public:
bool doesRender(int x, int y, int wid, int ht)
{
return renderer->doesRender(x,y,wid,ht);
}
void render(int x, int y)//renders with center at x,y
{
renderer->render(x,y);
}
};
any help would be greatly appreciated
You need to surround all header file you write with guard.
There are 2 solutions to do that but only the 2nd will really works with all compilers.
Visual Studio supports #pragma once. Put that on the 1st line of your header.
All compiler have a preprocessor. Surround all the text in your header file with
#ifdef ...
#define ...
other include, class declaration, etc...
#endif
Replace the ... by a unique identifier for your file; for example, I often use as a convention:
_filenameinlowercase_h_
If you already have a header guard, please make sure that you didn't included the same header file in it by mistake.
Example
#ifndef EXAMPLE_H_
#define EXAMPLE_H_
.
.
.
#include Example.h //It should be removed
.
.
#endif
Tip for the larger related issues. Sometimes the spelling might be off and it can be troubling to see where it is setup incorrectly if you have a large project with many include files.
I find compiling one file at a time can identify where the include was setup incorrectly.
What data type to use when setting a callback functions in GLFW?
I try setting a function to type void but gives me a compile error. Changing it to void __stdcall gives me an RT error, but how do I use the typedef's of GLFW such as GLFW*fun? I think this is the right one to do. I really need an example source code.
btw, I define GLFW as GLFW_DLL
UPDATE
My code's look like this:
(I did it in three ways)
1
prototype. because these* are below main
this one gives me a compile error(invalid conversion)
void MouseClick(int, int);
void Keyboard(int, int);
//...
2
//appending `__stdcall` get compiled but gives me `RT error`
void __stdcall MouseClick(int, int);
void __stdcall Keyboard(int, int);
3
on my other project, I use GLFW_BUILD_DLL and compiles in MSVS with casting.
glfwSetKeyCallback((GLFWkeyfun)Keyboard);
but now, I can't do it in MinGW with the GLFW_DLL
void MouseClick(int x, int y) {
}
in main...
int main() {
//glfw intialization...
glfwSetKeyCallback(Keyboard);
//other setters
}
but, how do I do it this way?
GLFWmouseposfun MousePos {
}
//...
According to the documentation for GLFW v2.x the prototype for what you pass to glfwSetKeyCallback (etc.) is
void GLFWCALL functionname( int key, int action );
Here is a complete C program which will print out the key events:
#include <stdio.h>
#include <GL/glfw.h>
void GLFWCALL keyfun(int key, int action) {
printf("%d %d\n", key, action);
}
int main() {
glfwInit();
glfwOpenWindow(640, 480, 0, 0, 0, 0, 0, 0, GLFW_WINDOW);
glfwSetKeyCallback(keyfun);
while(1) {
glfwSwapBuffers();
}
}
If this code doesn't work you are likely linking to GLFW incorrectly.
Ahm, sorry my fault. I just didn't noticed that I have this Vec2f To_OGL_Coords(int x, int y) inside void MousePos(int x, int y) which I haven't included in my post.
As I said, it is Vec2f which I left out the 3rd(z) coordinate to NULL that causes the runtime error. Method number 2 should work here, same as Jacob Parker's answer. I just really don't know much the effects of those pointers if not used correctly.
(PS. I am working on 2D that's why I neglected the z-coordinate. My bad)
I have to do one project and I was given dll and a header file with implemented functions needed for the project. I was told just to add the header file to the project but this way i get unresolve externals error if i try to use functions referenced in header. So what needs to be done to make everything work? Visual Studio 2010.
Here are the files i have: http://www.ipix.lt/images/33871682.png
And this is header file:
#ifndef __BIM482_RADAR__
#define __BIM482_RADAR__
int BIM482OpenRadar();
int BIM482AddPlane(double x, double y);
int BIM482SetPlaneColor(int planeidx, int coloridx);
int BIM482SetPlanePos(int planeidx, double x, double y);
void BIM482UpdateRadar();
#endif // __BIM482_RADAR__
I need to initiate gui with OpenRadar and pass information with those functions. How to start this thing?
You don't have a .lib-file to link against.
Maybe this can help you
http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/
or this:
http://support.microsoft.com/default.aspx?scid=kb;en-us;131313
or this:
http://www.asawicki.info/news_1420_generating_lib_file_for_dll_library.html
when you have generated the lib-file ,you must use __declspec(dllimport) on yuor functions in the header file.
An alternative to all of the above is to use LoadLibrary(...) in your source and write wrapper function for those function in the dll and call those dll funcions via GetProcAddress(...).
struct
{
HMODULE hDll;
int (*BIM482OpenRadar) ();
int (*BIM482AddPlane) (double x, double y);
int (*BIM482SetPlaneColor) (int planeidx, int coloridx);
int (*BIM482SetPlanePos) (int planeidx, double x, double y);
void (*BIM482UpdateRadar) ();
} dll_funcs = {0};
bool ExitRadar( LPCTSTR szDllPath )
{
if (dll_funcs.hDll)
FreeLibrary( dll_funcs.hDll );
return true;
}
bool InitRadar( LPCTSTR szDllPath )
{
if (dll_funcs.hDll)
return true;
dll_funcs.hDll = LoadLibrary( szDllPath );
if (!dll_funcs.hDll)
return false;
dll_funcs.BIM482OpenRadar = (int(*)())GetProcAddress( dll_funcs.hDll ,("BIM482OpenRadar") );
dll_funcs.BIM482AddPlane = (int(*)(double,double))GetProcAddress( dll_funcs.hDll ,("BIM482AddPlane") );
dll_funcs.BIM482SetPlaneColor = (int(*)(int,int))GetProcAddress( dll_funcs.hDll ,("BIM482SetPlaneColor") );
dll_funcs.BIM482SetPlanePos = (int(*)(int,double,double))GetProcAddress( dll_funcs.hDll ,("BIM482SetPlanePos") );
dll_funcs.BIM482UpdateRadar = (void(*)())GetProcAddress( dll_funcs.hDll ,("BIM482UpdateRadar") );
return true;
}
int BIM482OpenRadar ()
{ return (*dll_funcs.BIM482OpenRadar)(); };
int BIM482AddPlane (double x, double y)
{ return (*dll_funcs.BIM482AddPlane)( x ,y ); }
int BIM482SetPlaneColor (int planeidx, int coloridx )
{ return (*dll_funcs.BIM482SetPlaneColor)( planeidx ,coloridx ); }
int BIM482SetPlanePos (int planeidx, double x, double y)
{ return (*dll_funcs.BIM482SetPlanePos)( planeidx ,x ,y ); }
void BIM482UpdateRadar ()
{ return (*dll_funcs.BIM482UpdateRadar)(); }
There is a windows call that loads a DLL into your image. You can either add it to the compile setup in Visual Studio, or load it dynamically.
The easiest thing is probably to do it at compile time; google "Visual Studio llinking options".
You'll need to export the function from dll, while import the function from your exe. Like:
#if defined(XYZLIBRARY_EXPORT) // inside DLL
#define XYZAPI __declspec(dllexport)
#else // outside DLL
#define XYZAPI __declspec(dllimport)
#endif // XYZLIBRARY_EXPORT
int XYZAPI BIM482OpenRadar();
int XYZAPI BIM482AddPlane(double x, double y);
int XYZAPI BIM482SetPlaneColor(int planeidx, int coloridx);
int XYZAPI BIM482SetPlanePos(int planeidx, double x, double y);
void XYZAPI BIM482UpdateRadar();
In DLL, i suggest to add a macro, and add XYZLIBRARY_EXPORT in pre-processor
It will export all of your function.
In EXE, import the function, without adding pre-processor, as it will import the function by default.
In addition to including header files, you need to link your program with the corresponding libraries. From your screenshot, you seem to have .a files, which are indeed libraries, but unfortunately they are meant for use with the GCC toolchain and will not work with Visual Studio. You either need to get .lib files if you must use Visual Studio, or otherwise switch to a GCC port such as MinGW.
You may use windows API LoadLibrary to load the dll during runtime, followed by GetProcAddress to retrieve function address. With the function address is retrieved, you need to declare the method signature so that compiler know how to call given function.
Below is a sample code for how to "link" to function in Dll:
HINSTANCE m_hExtDll = LoadLibrary( "SDL.dll" )
if (m_hExtDll)
{
FARPROC m_pfnOpenRadar = GetProcAddress(m_hExtDll, "BIM482OpenRadar")
if (m_pfnOpenRadar)
{
typedef int (*OPENRADARFUNC)();
OPENRADARFUNC fnOpenRadar = (OPENRADARFUNC)m_pfnOpenRadar;
int iRetCode = fnOpenRadar();
}
}
Do note that functions exported are subject to name mangling and you can verify the function name using third-party utility like Dependency Walker.
I am getting confused on why the compiler is not recognizing my classes. So I am just going to show you my code and let you guys decide. My error is this
error C2653: 'RenderEngine' : is not a class or namespace name
and it's pointing to this line
std::vector<RenderEngine::rDefaultVertex> m_verts;
Here is the code for rModel, in its entirety. It contains the varible. the class that holds it is further down.
#ifndef _MODEL_H
#define _MODEL_H
#include "stdafx.h"
#include <vector>
#include <string>
//#include "RenderEngine.h"
#include "rTri.h"
class rModel {
public:
typedef tri<WORD> sTri;
std::vector<sTri> m_tris;
std::vector<RenderEngine::rDefaultVertex> m_verts;
std::wstring m_name;
ID3D10Buffer *m_pVertexBuffer;
ID3D10Buffer *m_pIndexBuffer;
rModel( const TCHAR *filename );
rModel( const TCHAR *name, int nVerts, int nTris );
~rModel();
float GenRadius();
void Scale( float amt );
void Draw();
//------------------------------------ Access functions.
int NumVerts(){ return m_verts.size(); }
int NumTris(){ return m_tris.size(); }
const TCHAR *Name(){ return m_name.c_str(); }
RenderEngine::cDefaultVertex *VertData(){ return &m_verts[0]; }
sTri *TriData(){ return &m_tris[0]; }
};
#endif
at the very top of the code there is a header file
#include "stdafx.h"
that includes this
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include "resource.h"
#include "d3d10.h"
#include "d3dx10.h"
#include "dinput.h"
#include "RenderEngine.h"
#include "rModel.h"
// TODO: reference additional headers your program requires here
as you can see, RenderEngine.h comes before rModel.h
#include "RenderEngine.h"
#include "rModel.h"
According to my knowledge, it should recognize it. But on the other hand, I am not really that great with organizing headers. Here my my RenderEngine Declaration.
#pragma once
#include "stdafx.h"
#define MAX_LOADSTRING 100
#define MAX_LIGHTS 10
class RenderEngine {
public:
class rDefaultVertex
{
public:
D3DXVECTOR3 m_vPosition;
D3DXVECTOR3 m_vNormal;
D3DXCOLOR m_vColor;
D3DXVECTOR2 m_TexCoords;
};
class rLight
{
public:
rLight()
{
}
D3DXCOLOR m_vColor;
D3DXVECTOR3 m_vDirection;
};
static HINSTANCE m_hInst;
HWND m_hWnd;
int m_nCmdShow;
TCHAR m_szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR m_szWindowClass[MAX_LOADSTRING]; // the main window class name
void DrawTextString(int x, int y, D3DXCOLOR color, const TCHAR *strOutput);
//static functions
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
bool InitWindow();
bool InitDirectX();
bool InitInstance();
int Run();
void ShutDown();
void AddLight(D3DCOLOR color, D3DXVECTOR3 pos);
RenderEngine()
{
m_screenRect.right = 800;
m_screenRect.bottom = 600;
m_iNumLights = 0;
}
protected:
RECT m_screenRect;
//direct3d Members
ID3D10Device *m_pDevice; // The IDirect3DDevice10
// interface
ID3D10Texture2D *m_pBackBuffer; // Pointer to the back buffer
ID3D10RenderTargetView *m_pRenderTargetView; // Pointer to render target view
IDXGISwapChain *m_pSwapChain; // Pointer to the swap chain
RECT m_rcScreenRect; // The dimensions of the screen
ID3D10Texture2D *m_pDepthStencilBuffer;
ID3D10DepthStencilState *m_pDepthStencilState;
ID3D10DepthStencilView *m_pDepthStencilView;
//transformation matrixs system
D3DXMATRIX m_mtxWorld;
D3DXMATRIX m_mtxView;
D3DXMATRIX m_mtxProj;
//pointers to shaders matrix varibles
ID3D10EffectMatrixVariable* m_pmtxWorldVar;
ID3D10EffectMatrixVariable* m_pmtxViewVar;
ID3D10EffectMatrixVariable* m_pmtxProjVar;
//Application Lights
rLight m_aLights[MAX_LIGHTS]; // Light array
int m_iNumLights; // Number of active lights
//light pointers from shader
ID3D10EffectVectorVariable* m_pLightDirVar;
ID3D10EffectVectorVariable* m_pLightColorVar;
ID3D10EffectVectorVariable* m_pNumLightsVar;
//Effect members
ID3D10Effect *m_pDefaultEffect;
ID3D10EffectTechnique *m_pDefaultTechnique;
ID3D10InputLayout* m_pDefaultInputLayout;
ID3DX10Font *m_pFont; // The font used for rendering text
// Sprites used to hold font characters
ID3DX10Sprite *m_pFontSprite;
ATOM RegisterEngineClass();
void DoFrame(float);
bool LoadEffects();
void UpdateMatrices();
void UpdateLights();
};
The classes are defined within the class
class rDefaultVertex
{
public:
D3DXVECTOR3 m_vPosition;
D3DXVECTOR3 m_vNormal;
D3DXCOLOR m_vColor;
D3DXVECTOR2 m_TexCoords;
};
class rLight
{
public:
rLight()
{
}
D3DXCOLOR m_vColor;
D3DXVECTOR3 m_vDirection;
};
Not sure if thats good practice, but I am just going by the book.
In the end, I just need a good way to organize it so that rModel recognizes RenderEngine. and if possible, the other way around.
[edit]
I can literally just point to the render engine class, and it still won't recognize
#ifndef _MODEL_H
#define _MODEL_H
//#include "stdafx.h"
#include <vector>
#include <string>
#include "RenderEngine.h" //<-------pointing to render engine. still does not recognize.
#include "rTri.h"
class rModel {
public:
typedef tri<WORD> sTri;
std::vector<sTri> m_tris;
std::vector<RenderEngine::rDefaultVertex> m_verts;
std::wstring m_name;
ID3D10Buffer *m_pVertexBuffer;
ID3D10Buffer *m_pIndexBuffer;
rModel( const TCHAR *filename );
rModel( const TCHAR *name, int nVerts, int nTris );
~rModel();
float GenRadius();
void Scale( float amt );
void Draw();
//------------------------------------ Access functions.
int NumVerts(){ return m_verts.size(); }
int NumTris(){ return m_tris.size(); }
const TCHAR *Name(){ return m_name.c_str(); }
RenderEngine::cDefaultVertex *VertData(){ return &m_verts[0]; }
sTri *TriData(){ return &m_tris[0]; }
};
#endif
As others mentioned, a decoupling/refactoring is in order here - stdafx.h is not meant to hold all header files your application has.
Your problem is that renderengine.h also includes stdafx.h. This time the renderengine.h include is ignored due to #pragma once and rmodel.h is included next - at the top of renderengine.h.
The simplest thing in your case would be to:
remove renderengine.h & rmodel.h from stdafx.h
rmodel.h includes renderengine.h
... done
I can't tell for sure, but RenderEngine.h probably includes rModel.h. Then when you include stdafx.h it brings in RenderEngine.h, but before it fully processes that header it then includes rModel.h. Then inside rModel.h the include guards prevent it from including stdafx.h again and it proceeds to compile rModel.h without full knowledge of anything in RenderEngine.h.
Without understanding the full relationship of your various classes its extremely hard to suggest a fix. Most likely you'll want to carefully consider which classes are defined in which headers and use forward declarations to remove the circular dependency.
It's pretty hard to understand all your dependencies and I think that your code needs refactoring (if not rewriting). Also, rushing into a rendering engine development without any architecture building experience (as I assume) generally results in crappy unreliable code, hacks "to make it work" and other evil stuff.
Anyway, in this case, try to decompose your application's parts and distinguish them. In your case, one of possible approaches would mean putting all rendering objects / structs such as Vertex, Light, Model in another header (you could call it render.types.h or render.objects.h or something like that).
Then you should simply make your rendering engine work with these render objects. Once you're done with it, you won't need statements like std::vector<RenderEngine::rDefaultVertex> m_verts; or RenderEngine::cDefaultVertex *VertData().
Note that this would also solve your circular dependencies, because your engine would only have to know about models, models - only about vertexes and so on.
If you still face the dependency troubles, use forward declarations. Google it for full description, and just a sample for you to understand what I mean:
class ForwardDeclared;
class Object {
ForwardDeclared* member;
void Method(const ForwardDeclared& fd) { (...) }
};
// This could also resude in another file
class ForwardDeclared { (...) };