Unhandled Exception error message
- by Joshua Green
Does anyone know why including a term such as:
t = PL_new_term_ref();
would cause an Unhandled Exception error message:
0xC0000005: Access violation reading location 0x0000000c.
(Visual Studio 2008)
I have a header file:
class UserTaskProlog : public ArAction
{
public:
UserTaskProlog( const char* name = " sth " );
~UserTaskProlog( );
AREXPORT virtual ArActionDesired *fire( ArActionDesired currentDesired );
private:
term_t t;
};
and a cpp file:
UserTaskProlog::UserTaskProlog( const char* name ) : ArAction( name, " sth " )
{
char** argv;
argv[ 0 ] = "libpl.dll";
PL_initialise( 1, argv );
PlCall( "consult( 'myProg.pl' )" );
}
UserTaskProlog::~UserTaskProlog( )
{
}
ArActionDesired *UserTaskProlog::fire( ArActionDesired currentDesired )
{
cout << " something " << endl;
t = PL_new_term_ref( );
}
Without t=PL_new_term_ref() everything works fine, but when I start adding my Prolog code (declarations first, such as t=PL_new_term_ref), I get this Access Violation error message.
I'd appreciate any help.
Thanks,