Hi,
I am converting my project from DBP to GDK and for the most part it has been going pretty good. I recently got to the terrain loading part of the code and included it in last night and got this error when linking:
Error 1 error LNK2005: "struct IDirect3DDevice9 * g_pD3DDevice" (?g_pD3DDevice@@3PAUIDirect3DDevice9@@A) already defined in terrain.lib(Basic.obj) D3Dfunc.lib
I was using the D3DLib functions with no issues.. just this code caused the linker issues.
dbMakeObjectSphere(sphereobj1,50);
dbMakeObjectSphere(sphereobj2,75);
dbSetCameraFOV(0,FOV);
dbPositionCamera(0,0,250,0);
i = freeimage();
j = freeimage();
dbLoadImage("Media\\Images\\Terrain\\texture.bmp", i);
dbLoadImage("Media\\Images\\Terrain\\detail.tga", j);
dbSetupTerrain ();
dbMakeObjectTerrain( TerrainObj );
dbSetTerrainHeightmap(TerrainObj,"Media\\Images\\Terrain\\map.bmp" );
dbSetTerrainScale(TerrainObj, 3, 0.6,3 );
dbSetTerrainSplit( TerrainObj, 16 );
dbSetTerrainTiling( TerrainObj, 4 );
dbSetTerrainLight( TerrainObj,1, -0.25, 0, 1, 1, 0.78, 0.5 );
dbSetTerrainTexture( TerrainObj, i, j );
dbBuildTerrain(TerrainObj );
Seems to me like something is conflicting between the two libs, but I cannot tell. Tried searching the board and found nothing besides the initial linker issues (MTd vs. MT).. I already went through those.
Any help would be appreciated.. been pulling my hair out trying to figure this one out.