Embeddor Woes...

Preston H palindrome12345 at hotmail.com
Thu Sep 11 02:58:24 CEST 2003


Hello, someone may have tackled this problem before but I have
searched the google newsgroups up and down and I can't find anything
on this.  I am trying to write an embedded python program in C++ that
will go out and execute python language in a script.

I am using Visual C++ .NET, and I do have Multithreaded DLL(/MD)
turned on for the Runtime Library, I have the Python 2.2 installed and
their include and libs directories are set.  Also, I have Visual C++
.NET set to release version, mainly because I cannot find
python22_d.dll anywhere.

This is the error that I get when I successfully compile this program
and try to run it at a dos prompt...

The instruction at "0x77f85c41" referenced memory at "0x00000010". 
The memory could not be "written".

This is the source code that I am trying to test...

#include "python.h"
#include <stdio.h>

int main(int argc, char* argv[])
{
	char *filename = "test.py";
	
	FILE *OurFile = fopen(filename, "r+");

	Py_Initialize();

	PyRun_SimpleFile(OurFile, "test.py");

	Py_Finalize();

	return 0;
}

Like I said earlier, the program compiles without any hitches.  Any
help on this is appreciated very much!




More information about the Python-list mailing list