Embedding problems???

G. David Kuhlman dkuhlman at netcom.com
Mon May 17 18:10:16 EDT 1999


Worked fine for me.

Some things to check:

1.  I removed the #include for stdafx.h.  Don't think it's a
conflict, but it's not needed.

2. I compiled with Project/Settings/C++/Code Generation set to
"Debug Multithreaded DLL".  I believe that the Python libraries are
compiled that way for Debug mode and are compiled with the
"Multithreaded DLL" setting for Release mode.  You need to be
consistent with that.

  - Dave



Jr. King <n at n.com> wrote:
> 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.






More information about the Python-list mailing list