When I comment out the Py_SetPath() function call (Line 56), then the code runs up to the 4th test print and then crashes again, possibly at: "Py_XDECREF(pArgs)" else it crashes at Py_Initalize. The same behavior can be observed under Python 3.4.0 and 3.4.1 and on both the MSVC and GCC compiler.
BTW: The multiply.py runs fine when called with "py -3" directly.
>>Output without Py_SetPath:
C:\Development\xxx\Testo1\Snakes\Release>Snakes.exe multiply multiply 3 2
Number of arguments 5
Will compute 3 times 2
Result: 6
***Test1***Test2***Test3Will compute 3 times 2
***Test4
>>Output with Py_SetPath:
C:\Development\xxx\Testo1\Snakes\Release>Snakes.exe multiply multiply 3 2
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
**Dev-Environment:
Windows 8.1 64bit, MSVC-2013 and MingW (installed with mingw-w64-install.exe downloaded in June 2014).
**Microsoft Visual Studio Professional 2013: v12.0.30501.00 Update2
**GCC/G++ Version:
C:\Development\xxx\Testo1\Snakes\Release>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/MingW64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-4.9.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --targe
t=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw490/x86_64-490-win32-seh-rt_v3-rev1/mingw64 --wi
th-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib
--enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=win32 --ena
ble-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic
-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --dis
able-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --dis
able-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 -
-with-libiconv --with-system-zlib --with-gmp=/c/mingw490/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/
c/mingw490/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw490/prerequisites/x86_64-w64-mingw32-sta
tic --with-isl=/c/mingw490/prerequisites/x86_64-w64-mingw32-static --with-cloog=/c/mingw490/prerequisites/x86_
64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-win32-seh-rev1, Built by MinGW-W64
project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw490/x86_64-490-wi
n32-seh-rt_v3-rev1/mingw64/opt/include -I/c/mingw490/prerequisites/x86_64-zlib-static/include -I/c/mingw490/pr
erequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw490/x86_64-490-win32-seh-rt_v3-re
v1/mingw64/opt/include -I/c/mingw490/prerequisites/x86_64-zlib-static/include -I/c/mingw490/prerequisites/x86_
64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw490/x86_64-490-win32-seh-rt_v3-rev1/mingw64/
opt/lib -L/c/mingw490/prerequisites/x86_64-zlib-static/lib -L/c/mingw490/prerequisites/x86_64-w64-mingw32-stat
ic/lib'
Thread model: win32
gcc version 4.9.0 (x86_64-win32-seh-rev1, Built by MinGW-W64 project)
|