python termination error when ctypes dll calls printf -
I am developing a dragon system with some core DLL accessed via CTIP. I have reduced this problem in this condition: execute a module that loads (no need to call) Two DLL, one of which is called printf - this error is exited.
Requested to end this application runtime abnormally. For more information, please contact the application's support team.
My environment:
- Windows 7, SP1 - Python 2.7.8 - Miniziw 3.20
This tutorial will help you with a tutorial on writing DLL with minidade Optimized:
/ * add_core.c * / __declspec (dllexport) int sum (int a, int b) {return a + b; } / * Sub_core.c * / #include & lt; Stdio.h & gt; __DCLC (Dilexport) int sum (int a, int b) {printf ("hello to all_core"); Return A - B; } prog.py
import ctypes add_core_dll = ctypes.cdll.LoadLibrary ('add_core.dll') add_core_dll = ctypes.cdll.LoadLibrary (' Sub_core.dll ') & gt; GCC -Wall -O3 -g -ansi -c add_core.c -o add_core.o GCC -G-L-Ensy-Lion add_core.o -o add_core.dll gcc -Wall -O3 -g -ansi -c sub_core C -o sub_core.o gcc-g-l -sansi -shared sub_core.o -o sub_core.dll & gt; Python prog.py This application has requested to end the runtime abnormally. Please contact the application's support team for more information. And pop up a message dialog for the same effect: "python.exe has stopped working ...".
Note that the programs are executed as expected and the output is at the end of normal output. This error is just a big nuisance which I would like to get rid of.
For the same reason: Windows 7 Enterprise, SP1 Python 2.7.11 Mingav 32-G ++ XE 5.3.0
Comments
Post a Comment