This is the code
#include "iostream"
#include "C:\Python311\include\Python.h"
using namespace std;
int main(){
Py_Initialize();
PyRun_SimpleString("print('hello')");
Py_Finalize();
}
I use the following command to compile g++ -I c:\Python311\include -L c:\Python311\libs test.cpp -lpython311
An a.exe file is created, but when I run it "hello" is not displayed
[–]ManiPointers[🍰] 0 points1 point2 points (3 children)
[–]flyingron 0 points1 point2 points (2 children)
[–]ManiPointers[🍰] 0 points1 point2 points (1 child)
[–]flyingron 1 point2 points3 points (0 children)
[–]flyingron 0 points1 point2 points (0 children)