I want to use some Python code in my C++ framework to plot some statistics. I have already found the following posting (about how to embedd python in c++) but following the instructions did not lead to success: Embed python code in C++ (Windows + minGW + Python 2.7.2 + Eclipse)
#include "Python.h"
int main(int f_argc, const char* f_argv [])
{
Py_Initialize();
const char* pythonScript = "print 'Hello, world!'\n";
int result = PyRun_SimpleString(pythonScript);
Py_Finalize();
return 0;
}
I am sorry, but I do not have much experience with make files or attaching static or dynamic libraries....
I have to following system: Windows 7 + 64 Bit + Eclipse IDE for C/C++ Developers, Version: Juno Service Release 1 + mingw + python32
under path and symbols: + added include directory of python32 + added library "python32" which should correspond to libpython32.a + added library path
The compiling and linking seems to work, but when I try to start the exe, I get the following message:
"The program can't start because python32.dll is missing from your computer. Try reinstalling the program to fix this problem."
I cannot understand this message because I try to add a static library (libpython32.a) to the source. Could you give me a gentle push in the right direction?
Thank you very much for your help!
EDIT: added makefile and objects.mk
MAKEFILE ################################################################################ # Automatically-generated file. Do not edit! ################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: Sandbox.exe
# Tool invocations
Sandbox.exe: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -L"C:\Python32\libs" -o "Sandbox.exe" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) Sandbox.exe
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
OBJECTS.MK
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS := -lgdi32 -ljpeg-8 -ltiff-5 -lpython32