如何将python嵌入到bcc64项目中?

2024-05-21 04:11:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我将一个项目从C++ NavaCabro XE6 32位移植到XE6 64位。我们使用嵌入式python库(以及一些用C编写的python模块)。在

我可以让它编译,但是我不能链接,因为在Python目录中没有任何lib可以被编译器bcc64(基于clang的编译器)使用。在

这是我的代码,它只是文档中的一个简单的“这是如何嵌入python”的示例。我们使用python3.1;我们可以升级,但我也看不到更新版本中的libs。在

#define HAVE_ROUND
#define HAVE_ACOSH
#define HAVE_ASINH
#define HAVE_ATANH

#include <Python.h>

#pragma hdrstop
#pragma argsused

#ifdef _WIN32
#include <tchar.h>
#else
    typedef char _TCHAR;
    #define _tmain main
#endif

#include <stdio.h>

 int _tmain(int argc, _TCHAR* argv[]) 
{
    // Invoke the python intepreter
    Py_Initialize();
    PyRun_SimpleString("from time import time,ctime\n"
                                         "print('Today is', ctime(time()))\n");
    Py_Finalize();

    system("Pause");
    return 0;
}

Tags: 模块项目py编译器includetimehaveint