Would you know why these compilation errors happen Vluzacn?
writebsp.cpp:534
Code:
dplane_t *mp = &g_mapplanes[i];
Error 1 error C2065: 'g_mapplanes' : undeclared identifier
qbsp.cpp:1378
Code:
plane_t *mp = &g_mapplanes[i];
Error 2 error C2065: 'plane_t' : undeclared identifier
Error 3 error C2065: 'mp' : undeclared identifier
Error 4 error C2065: 'g_mapplanes' : undeclared identifier
qbsp.cpp:1380
Code:
VectorCopy (dp->normal, mp->normal);
Error 5 error C2065: 'mp' : undeclared identifier
Error 6 error C2227: left of '->normal' must point to class/struct/union/generic type
Error 7 error C2065: 'mp' : undeclared identifier
Error 8 error C2227: left of '->normal' must point to class/struct/union/generic type
Error 9 error C2065: 'mp' : undeclared identifier
Error 10 error C2227: left of '->normal' must point to class/struct/union/generic type
qbsp.cpp:1381
Code:
mp->dist = dp->dist;
Error 11 error C2065: 'mp' : undeclared identifier
Error 12 error C2227: left of '->dist' must point to class/struct/union/generic type
qbsp.cpp:1382
Code:
mp->type = dp->type;
Error 13 error C2065: 'mp' : undeclared identifier
Error 14 error C2227: left of '->type' must point to class/struct/union/generic type
qbsp.cpp:1389
Code:
if (q_filelength (planefile) != g_numplanes * sizeof (dplane_t))
Error 15 error C2065: 'plane_t' : undeclared identifier
Error 16 error C2070: ''unknown-type'': illegal sizeof operand
qbsp.cpp:1393
Code:
SafeRead (planefile, g_dplanes, g_numplanes * sizeof (dplane_t));
Error 17 error C2065: 'g_mapplanes' : undeclared identifier
Error 18 error C2065: 'plane_t' : undeclared identifier
Error 19 error C2070: ''unknown-type'': illegal sizeof operand
I'm guessing the root cause is plane_t and g_mapplanes not being declared. VL20 compiled fine.
Simply adding #include "..\hlcsg\csg.h" did help, but did not entirely cure. It just throws a bunch of unresolved externals:
Warning 1 warning C4005: 'BOGUS_RANGE' : macro redefinition csg.h 110 hlbsp
Warning 2 warning C4005: 'BOGUS_RANGE' : macro redefinition csg.h 110 hlbsp
Error 3 error LNK2005: "struct dplane_t * g_dplanes" (?g_dplanes@@3PAUdplane_t@@A) already defined in qbsp.obj bspfile.obj hlbsp
Error 4 error LNK2019: unresolved external symbol "struct plane_t * g_mapplanes" (?g_mapplanes@@3PAUplane_t@@A) referenced in function "void __cdecl ProcessFile(char const * const)" (?ProcessFile@@YAXQBD@Z) qbsp.obj hlbsp
Error 5 error LNK2001: unresolved external symbol "struct plane_t * g_mapplanes" (?g_mapplanes@@3PAUplane_t@@A) writebsp.obj hlbsp
Also HLRAD fails to build due to these issues:
Error 7 error LNK2019: unresolved external symbol "struct radtexture_t * g_textures" (?g_textures@@3PAUradtexture_t@@A) referenced in function "void __cdecl MakePatchForFace(int,class Winding *,int)" (?MakePatchForFace@@YAXHPAVWinding@@H@Z) qrad.obj hlrad
Error 8 error LNK2001: unresolved external symbol "struct radtexture_t * g_textures" (?g_textures@@3PAUradtexture_t@@A) trace.obj hlrad
Error 9 error LNK2019: unresolved external symbol "void __cdecl LoadTextures(void)" (?LoadTextures@@YAXXZ) referenced in function _main qrad.obj hlrad
Error 10 error LNK2019: unresolved external symbol "void __cdecl AddWadFolder(char const *)" (?AddWadFolder@@YAXPBD@Z) referenced in function _main qrad.obj hlrad