While in the process of compiling my game engine thus far into a static lib I ran into a very strange error.
The declarations in my class are:
Code:
...
DXInput *m_pInput;
DXMouse *m_pMouse;
DXKeyboard *m_pKeyboard;
...
And the code to new them up is:
Code:
...
m_pInput = new DXInput();
if (!m_pInput)
{
return false;
}
m_pInput->Init(m_hAppInstance);
m_pKeyboard = new DXKeyboard();
if (!m_pKeyboard)
{
return false;
}
m_pKeyboard->Init(m_pInput,m_hAppInstance,m_hwndAppWindowHandle);
m_pMouse = new DXMouse(m_pInput->GetInterface());
if (!m_pMouse)
{
return false;
}
m_pMouse->Init(m_hwndAppWindowHandle);
...
The errors in release mode - and only in release mode:
1>..\src\D3DApp.cpp(61) : error C2440: '=' : cannot convert from 'DXInput' to 'DXInput *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>..\src\D3DApp.cpp(64) : error C2440: '=' : cannot convert from 'DXKeyboard' to 'DXKeyboard *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>..\src\D3DApp.cpp(71) : error C2440: '=' : cannot convert from 'DXMouse' to 'DXMouse *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Release build wants me to put the address of operator before the new but debug build then throws up this which is expected:
1>e:\dev\x3dlib\src\d3dapp.cpp(61) : error C2102: '&' requires l-value
1>e:\dev\x3dlib\src\d3dapp.cpp(64) : error C2102: '&' requires l-value
1>e:\dev\x3dlib\src\d3dapp.cpp(71) : error C2102: '&' requires l-value
This is clearly a compiler goof up and I do not know how to get past it.