I cannot use int * as a function parameter..
here is my example test
class
VxTest
{
public
:
//=== constructor ===//
VxTest(){};
//=== destructor ===//
virtual ~VxTest(){};
//! initialize sound manager
RCODE StartupVxTest( irr::VxIrrBase * poMgr );
//! shutdown sound manager
void ShutdownVxTest( void );
//! play a sound 2d
//! returns handle to sound stream
virtual int PlaySound2d( const char * pFileName, // file name
int bLooping=0, // if true loop continuous
int * piRetSndChannel=0 );// return handle to sound source instance
//! register sound object with squirrel scripting
static void RegisterWithSquirrelScripting( void );
};
DECLARE_INSTANCE_TYPE(VxTest);
// declare type for squirrel
//! returns handle to sound stream
int
VxTest::PlaySound2d( const char * pFileName, // file name
int bLooping, // if true loop continuous
int * piRetSndChannel )// return handle to sound source instance
{
return 0;
}
//---------------------------------------------------------------------------
//! register sound object with squirrel scripting
void
VxTest::RegisterWithSquirrelScripting( void )
{
// register squirrel interface
SqPlus::SQClassDef<VxTest> ( _T(
"VxTest") ).
func( &VxTest::PlaySound2d, _T(
"PlaySound2d") );
}
when I try to compile with visual studio 2008 I get
DracIrrLibD.lib(VxSoundMgr.obj) : error LNK2019: unresolved external symbol "int * __cdecl SqPlus::Get<int>(struct SqPlus::TypeWrapper<int *>,struct SQVM *,int)" (??$Get@H@SqPlus@@YAPAHU?$TypeWrapper@PAH@0@PAUSQVM@@H@Z) referenced in function "public: static int __cdecl SqPlus::ReturnSpecialization<int>::Call<class VxTest,char const *,int,int *>(class VxTest &,int (__thiscall VxTest::*)(char const *,int,int *),struct SQVM *,int)" (??$Call@VVxTest@@PBDHPAH@?$ReturnSpecialization@H@SqPlus@@SAHAAVVxTest@@P82@AEHPBDHPAH@ZPAUSQVM@@H@Z)
DracIrrLibD.lib(VxSoundMgr.obj) : error LNK2019: unresolved external symbol "bool __cdecl SqPlus::Match<int>(struct SqPlus::TypeWrapper<int *>,struct SQVM *,int)" (??$Match@H@SqPlus@@YA_NU?$TypeWrapper@PAH@0@PAUSQVM@@H@Z) referenced in function "public: static int __cdecl SqPlus::ReturnSpecialization<int>::Call<class VxTest,char const *,int,int *>(class VxTest &,int (__thiscall VxTest::*)(char const *,int,int *),struct SQVM *,int)" (??$Call@VVxTest@@PBDHPAH@?$ReturnSpecialization@H@SqPlus@@SAHAAVVxTest@@P82@AEHPBDHPAH@ZPAUSQVM@@H@Z)
../../../bin/win32/SlytronWorldBuilder.exe : fatal error LNK1120: 2 unresolved externals
If I change
virtual int PlaySound2d( const char * pFileName, int bLooping=0, int * piRetSndChannel=0 )
to
virtual int PlaySound2d( const char * pFileName, int bLooping=0, int piRetSndChannel=0 )
then it compiles fine.
Am I not allowed to use int pointers as parameters?