Unhandled Exception error message

Posted by Joshua Green on Stack Overflow See other posts from Stack Overflow or by Joshua Green
Published on 2010-04-10T20:00:34Z Indexed on 2010/04/10 20:03 UTC
Read the original article Hit count: 276

Filed under:
|

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,

© Stack Overflow or respective owner

Related posts about swi-prolog

Related posts about vs2008