C++ Python closes my program
<p>Hey i am writing a small program with Direct3D and Python in C++.
I created my window and everything is working fine. But if i try to call "Py_Initialize();" my program closes.</p>

<p>(It closes with code 1)
What is the problem?</p>

<p>EDIT: Here are some parts of my code.</p>

<p><strong>MainIncludes.h</strong></p>

<pre><code>#include "Windows.h"
#include &lt;d3d9.h&gt;
#pragma comment (lib, "d3d9.lib")

#include &lt;d3dx9.h&gt;
#pragma comment (lib, "d3dx9.lib")
</code></pre>

<p><strong>main_d3dwindow.cpp</strong></p>

<pre><code>int WINAPI WinMain(HINSTANCE hInstance,
               HINSTANCE hPrevInstance,
               LPSTR lpCmdLine,
               int nCmdShow)
{
HWND hWnd;
WNDCLASSEX wc;

ZeroMemory(&amp;wc, sizeof(WNDCLASSEX));

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.lpszClassName = L"WindowClass";

RegisterClassEx(&amp;wc);

hWnd = CreateWindowEx(NULL,
                      L"WindowClass",
                      L"Program",
                      WS_OVERLAPPEDWINDOW,
                      300, 300,
                      800, 600,
                      NULL,
                      NULL,
                      hInstance,
                      NULL);

ShowWindow(hWnd, nCmdShow);
mainWindow = hWnd;

initD3D(hWnd);
init_python();

MSG msg;

while(TRUE)
{
    while(PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }

    if(msg.message == WM_QUIT)
        break;

    render_frame();
}

cleanD3D();

return msg.wParam;
}
</code></pre>

<p><strong>main_python.cpp</strong></p>

<pre><code>#include "Python.h"
void init_python() {
     Py_Initialize();
}
</code></pre>
