Sorry to be a pain, but im gettin some link errors that im not sure how to resolve with the new version, here is the copy/paste of the linker :
1>------ Build started: Project: Dark GDK - Game1, Configuration: Release Win32 ------
1>Compiling...
1>Main.cpp
1>Linking...
1>light.lib(CLightC.obj) : error LNK2005: "struct GlobStruct * g_pGlob" (?g_pGlob@@3PAUGlobStruct@@A) already defined in core.lib(DBDLLCore.obj)
1>basic3D.lib(CommonC.obj) : error LNK2005: "void __cdecl DestructorD3D(void)" (?DestructorD3D@@YAXXZ) already defined in light.lib(CLightC.obj)
1>basic3D.lib(CommonC.obj) : error LNK2005: "struct IDirect3DDevice9 * (__cdecl* g_GFX_GetDirect3DDevice)(void)" (?g_GFX_GetDirect3DDevice@@3P6APAUIDirect3DDevice9@@XZA) already defined in light.lib(CLightC.obj)
1>basic3D.lib(CommonC.obj) : error LNK2005: "struct IDirect3DDevice9 * m_pD3D" (?m_pD3D@@3PAUIDirect3DDevice9@@A) already defined in light.lib(CLightC.obj)
1>LINK : fatal error LNK1104: cannot open file 'dplayx.lib'
1>Build log was saved at "file://c:Documents and SettingsPaulMy DocumentsVisual Studio 2008ProjectsPWGDKLibrary BaseDark GDK - Game1ReleaseBuildLog.htm"
1>Dark GDK - Game1 - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
and the Error List :
Error 1 error LNK2005: "struct GlobStruct * g_pGlob" (?g_pGlob@@3PAUGlobStruct@@A) already defined in core.lib(DBDLLCore.obj) light.lib
Error 3 error LNK2005: "struct IDirect3DDevice9 * (__cdecl* g_GFX_GetDirect3DDevice)(void)" (?g_GFX_GetDirect3DDevice@@3P6APAUIDirect3DDevice9@@XZA) already defined in light.lib(CLightC.obj) basic3D.lib
Error 4 error LNK2005: "struct IDirect3DDevice9 * m_pD3D" (?m_pD3D@@3PAUIDirect3DDevice9@@A) already defined in light.lib(CLightC.obj) basic3D.lib
Error 2 error LNK2005: "void __cdecl DestructorD3D(void)" (?DestructorD3D@@YAXXZ) already defined in light.lib(CLightC.obj) basic3D.lib
Error 5 fatal error LNK1104: cannot open file 'dplayx.lib' Dark GDK - Game1
Here is the code im compiling, its runs fine under 7.3 and under, which I have installed..
#include "DarkGDK.h"
char* ta;
char* tb;
// pass this func a DWORD mask value to display which camera it will sync - integers are for cursor position for the text
void whatCamera(DWORD mask)
{
dbSetCursor(0,0);
int c;
for(c = 0; c <= 31; c++)
{
DWORD value = (1 << c);
if((mask & value) > 0)
{
tb = new char[256];
dbInk(0xFF00FF00, 0);
strcpy(tb, "Camera ");
strcat(tb, dbStr(c));
strcat(tb, " is rendered");
dbPrint(tb);
delete []tb;
}
else
{
dbInk(0xFFFF0000, 0);
ta = new char[256];
strcpy(ta, "Camera ");
strcat(ta, dbStr(c));
strcat(ta, " is not rendered");
dbPrint(ta);
delete []ta;
}
}
}
// set "msk" to be initial only masking camera 4 and 3
DWORD msk = ( 1 << 4 ) | ( 1 << 3 );
void DarkGDK()
{
dbSyncOn();
dbSyncRate(60);
dbSetDisplayMode(800, 600, 32);
dbSetWindowPosition(0, 0);
dbBackdropOn();
// add camera 2 to the mask value of msk - it works :)
msk = msk + (1 << 2);
int nopress = 0;
int DispCamVal = 0;
dbMakeObjectCube(1, 5.0);
dbPositionCamera(0, 0, -20);
sObject* pObject = dbGetObject(1);
pObject->dwCameraMaskBits = (1 << 0);
while (LoopGDK())
{
dbRotateObject(1, dbObjectAngleX(1)+0.1, dbObjectAngleY(1)+0.1, dbObjectAngleZ(1)+0.5);
// whatCamera(0x3fffffff);
//
switch(DispCamVal)
{
case 0:
// as for msk value... it is camera 2 3 and 4 rendered
//whatCamera(msk);
whatCamera(0x0000000b);
//dbText(300, 0, "Value was : ( 1 << 4 ) | ( 1 << 3 ) + (1 << 2)");
dbText(300, 0, "Value was : 0x0000000b");
break;
case 1:
// this one will render all cameras except 30 and 31
//whatCamera(powf(2.00, 2) + powf(2.0, 3));
whatCamera(0x0000000c);
dbText(300, 0, "Value was : 0x0000000c");
break;
case 2:
// this will render cam 8, 21, 4, 3, 2
whatCamera(0x00000008);
dbText(300, 0, "Value was : 0x00000008");
//whatCamera( (1 << 8) | (1 << 21) | msk);
//dbText(300, 0, "Value was : (1 << 8) | (1 << 21) PLUS ");
//dbText(300, 10, "( 1 << 4 ) | ( 1 << 3 ) + (1 << 2)");
break;
}
// press key 1 2 or 3 to change display....
if(dbKeyState(2) && nopress == 0) { DispCamVal = 0; nopress = 1; }
if(dbKeyState(3) && nopress == 0) { DispCamVal = 1; nopress = 1; }
if(dbKeyState(4) && nopress == 0) { DispCamVal = 2; nopress = 1; }
if(dbScanCode() == 0) nopress = 0;
dbSync();
}
return;
};
The only variable that I can think could possibly be affecting it would be that I am using the March 2009 DirectX SDK, with a custom "dummy" multiplayer.lib ... however these link errors occur either with the "dummy" multiplayer.lib, or the GDK multiplayer.lib and are the same regardless.
Ill dig out my august07 DXSDK and reinstall its libraries so I can make sure its not actually that causing the link errors.(if it is ill post bak to say so)
Also I should probably also let you know how I installed it, I tried a few of different ways. First I unzipped the archive and just pointed visual studio to the appropriate directories, then I tried copying the archive's files over the top of the already installed GDK 16-11-2007 version, and the same with GDK 7.3(the ones that have plugins installed-dark phys, AI, lights) , I then tried copying the archive over the top of "clean" original and 7.3 GDK(no plugins installed, just GDK libs). All of the above resulted in the same linker errors that I posted above
...
EDIT : I should also say, the above code is just what I had to hand, the same link errors happen on a new project generated by the wizard and empty.
EDIT EDIT : Ive un-installed march09 directx SDK and re-installed august07 directx sdk, it seems to give even more link errors with the 7.4 archive files, whereas it works fine with 7.3 and under. Hope this is something simple to fix, I really wouldnt mind digging around in the new library
Has anybody else had similar problems with 7.4 ? If it works for the majority of people, ill have to assume its my setup and start pulling it apart to find the cause
If it ain't broke.... DONT FIX IT !!!