简体   繁体   中英

Boost compilation error with python

I'm new to the boost C++ library and I'm trying to use boost with python. Whenever I compile my simple test program I get an error:

error: pyconfig.h: No such file or dirctory 

(followed by thousand more errors which I'm sure are because of this missing header). I downloaded boost from it's website and then built the library. I still have no idea why that file is missing and how to get it. Please help!

I'm using code::blocks MinGW compiler and I have pointed code blocks to the boost folder as a search directory for headers as well as libraries. Here's my simple program:

#include <boost/python.hpp>

using namespace boost::python;

int main()
{
    Py_Initialize();
    PyRun_SimpleString("from time import time,ctime\n"
                        "print ’Today is’,ctime(time())\n");
    Py_Finalize();
    return 0;
}

You apparently do not have the CPython headers in your include path. Just having boost::python is not enough, you need Python itself, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM