Embedding problems???
Gordon McMillan
gmcm at hypernet.com
Mon May 17 22:44:43 EDT 1999
Jr. King writes:
As G. David Kuhlman pointed out, the most likely cause is mixing
different c runtime libs.
Note that use of C++ streams will _not_ mix with Python's use of C
stdio. Use printf exclusively.
> I have this code here
> // learnPyth.cpp : Defines the entry point for the console
> application. //
>
> #include "stdafx.h"
> #include "python.h"
> #include "stdio.h"
> #include <iostream.h>
>
> int main(int argc, char* argv[])
> {
> Py_Initialize();
> char input[200];
> int ret;
> FILE *fp;
> fp = fopen("miniedit.py","r+");
> if(fp == NULL)
> cout<<"Didn't open file";
> else{
> ret = PyRun_AnyFile(fp,"miniedit.py");
> cout<<ret;
> fclose(fp);
> }
> printf("Hello World!\n");
> return 0;
> }
>
> I crashes with what looks like a illegal access error, inside of
> ntdll.dll I think. Looks like it stems from an fget. Any Ideas on
> what I need to do. This is a MSVC++ 6.0 on NT 4.0 sp4. The MSVC app
> is default as in I didn't change any switches and I only add the
> python.lib thingy.
>
>
>
> --
> http://www.python.org/mailman/listinfo/python-list
- Gordon
More information about the Python-list
mailing list