@Benjamin, sorry I don't get what you're saying. Could you post an example of "the functions in that file calling each other"...mmm all the functions are called from some other file.
@Ron, good question, as I'm unable to compile the simple examples with just one file, so we better forget about the multi-file setup.
Let's see, this is what I get when I try to compile example one:
Project.obj : error LNK2001: unresolved external symbol "struct D3DXMATRIX __cdecl EZro_GY(struct D3DXMATRIX,float)" (?EZro_GY@@YA?AUD3DXMATRIX@@U1@M@Z)
Project.obj : error LNK2001: unresolved external symbol "struct D3DXMATRIX __cdecl EZro_GZ(struct D3DXMATRIX,float)" (?EZro_GZ@@YA?AUD3DXMATRIX@@U1@M@Z)
Project.obj : error LNK2001: unresolved external symbol "struct D3DXMATRIX __cdecl EZro_GX(struct D3DXMATRIX,float)" (?EZro_GX@@YA?AUD3DXMATRIX@@U1@M@Z)
Release/Project.exe : fatal error LNK1120: 3 unresolved externals
However this code builds fine (example1 with commented EZro_G functions):
//EZroate Enhanced for The Game Creators GDK
//Features Demo 1: Global Rotation Comparison
//---------------------------------------------
//by: Ron Erickson 17-Feb-05
//updated: 30-Sep-07 for EZrotate v4 update
#pragma warning( disable : 4244 4305 )
#include "DarkGDK.h"
#include "EZrotate.h"
void DarkGDK ( void )
{
// **********************
// Setup
// **********************
dbSyncOn ( );
dbSyncRate (0);
dbBackdropOn ( );
dbAutoCamOff ( );
dbMaximiseWindow( );
dbSetWindowOff( );
dbSetDisplayMode( 1024, 768, 32 );
// **********************
// Load Objects:
// **********************
dbLoadImage ( "media/ball.jpg", 1 );
// Sphere Controlled By EZrotate command set
// ---------------------------------------------
dbMakeObjectSphere ( 1, 2.0f );
dbPositionObject ( 1, -4.0f, 0.0f, 0.0f );
dbTextureObject ( 1, 1 );
//Make a Matrix to store the Sphere's orientation
D3DXVECTOR3 Sphere1Euler;
D3DXMATRIX Sphere1Matrix;
// Sphere Controlled By DBpro command set
// ---------------------------------------------
dbMakeObjectSphere ( 2, 2.0f );
dbPositionObject ( 2, 4.0f, 0.0f, 0.0f );
dbTextureObject ( 2, 1 );
// Variables to Keep Track of Object Rotation
float DBball_Xrot = 0.0f, DBball_Yrot = 0.0f, DBball_Zrot = 0.0f;
// Backdrop
// ---------------------------------------------
dbMakeObjectPlane ( 3, 20.0f, 20.0f );
dbLoadImage ( "media/space.jpg", 2 );
dbTextureObject ( 3, 2 );
// Camera
// ---------------------------------------------
dbPositionCamera ( 0.0f, 0.0f , -10.0f);
// Control Variables
char* szKey;
// **********************
// Main Loop:
// **********************
while ( LoopGDK ( ) )
{
if ( dbEscapeKey ( ) )
return;
// Set Sphere1's Matrix to the object's current orientation
Sphere1Euler.x = dbObjectAngleX(1);
Sphere1Euler.y = dbObjectAngleY(1);
Sphere1Euler.z = dbObjectAngleZ(1);
Sphere1Matrix = EZro_Euler2Matrix( Sphere1Euler );
// X Rotation
// -------------------------
if ( dbUpKey() == 1)
{
//Sphere1Matrix = EZro_GX( Sphere1Matrix, 1.0 ); //DOES NOT LINK
DBball_Xrot = DBball_Xrot + 1.0;
}
if ( dbDownKey() == 1)
{
//Sphere1Matrix = EZro_GX( Sphere1Matrix, -1.0 ); //DOES NOT LINK
DBball_Xrot = DBball_Xrot - 1.0;
}
// Y Rotation
// -------------------------
if ( dbRightKey() == 1)
{
//Sphere1Matrix = EZro_GY( Sphere1Matrix, 1.0 ); //DOES NOT LINK
DBball_Yrot = DBball_Yrot + 1;
}
if ( dbLeftKey() == 1)
{
//Sphere1Matrix = EZro_GY( Sphere1Matrix, -1.0 ); //DOES NOT LINK
DBball_Yrot = DBball_Yrot + 1;
}
// Z Rotation
// -------------------------
szKey = dbInKey ( );
if ( strcmp ( szKey, "+" ) == 0 )
{
//Sphere1Matrix = EZro_GZ( Sphere1Matrix, 1.0 ); //DOES NOT LINK
DBball_Zrot = DBball_Zrot + 1;
}
if ( strcmp ( szKey, "-" ) == 0 )
{
//Sphere1Matrix = EZro_GZ( Sphere1Matrix, -1.0 ); //DOES NOT LINK
DBball_Zrot = DBball_Zrot - 1;
}
// Reset Rotation
// -------------------------
if ( dbSpaceKey() == 1)
{
//Reset Sphere1 (EZrotate controlled)
Sphere1Euler.x = 0;
Sphere1Euler.y = 0;
Sphere1Euler.z = 0;
Sphere1Matrix = EZro_Euler2Matrix( Sphere1Euler );
//Reset DBpro Object
DBball_Xrot = 0;
DBball_Yrot = 0;
DBball_Zrot = 0;
}
//Rotate the First Object Using EZrotate's Command Set
Sphere1Euler = EZro_Matrix2Euler( Sphere1Matrix );
dbRotateObject(1, Sphere1Euler.x, Sphere1Euler.y, Sphere1Euler.z);
//Rotate the Second Object Using the Inc/Dec Variables
dbRotateObject(2, DBball_Xrot, DBball_Yrot, DBball_Zrot);
dbText ( 0,0,dbStr(dbScreenFPS()) );
dbText ( 0,10, "EZ-Rotate Enhanced for GDK" );
dbText ( 0,20, "Features Demo 1: Global Rotation Comparison" );
dbText ( 0,30, "By: Ron Erickson" );
dbText ( 0,40, "visit: www.GameToolshed.com" );
dbText ( 0,50, "-------------------------------------------------------------" );
dbText ( 0,60, " X Rotation - Up and Down arrows" );
dbText ( 0,70, " Y Rotation - Left and Right arrows" );
dbText ( 0,80, " Z ROtation - + and - keys" );
dbText ( 0,90, " SPACEKEY to Reset" );
dbText ( 0,100, "-------------------------------------------------------------" );
dbText ( 0,110, "EZrotate Global Rotation = Left side of Screen" );
dbText ( 0,120, "INC/DEC Euler angles for rotation = Right side of Screen" );
dbText ( 0,130, "-------------------------------------------------------------" );
dbText ( 0,140, "What to look for:" );
dbText ( 0,150, "Once rotation is applied on the Z axis (+/-)" );
dbText ( 0,160, "notice what happens when you rotate on the X or Y axis." );
dbText ( 0,170, "When you use EZrotate your object will continue to" );
dbText ( 0,180, "to rotate on true global axis." );
dbSync ( );
}
}
As you can see, there are some other used EZRotate functions at the code that still build fine, so that's what confuses me, shouldn't it be all or none?
By the way, if I open the examples .sln file, I get the link errors shown above. If I open the .dsw file i get this:
If I accept the dialog, then even more link errors appear. Please note that I'm using VS2005 Professional Edition.
Also, I forgot to comment that 'EZrotate.h' has been placed at the DGDK includes folder, while 'EZrotate.lib' is at LibVS8, DGDK libraries folder.