我正在尝试在我的 ubuntu 上构建 boost python 库。但是,当我执行
./b2 --with-python
Run Code Online (Sandbox Code Playgroud)
它总是返回与我相关的错误
./boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
# include <pyconfig.h>
^~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)
我尝试在线查找,例如https://github.com/boostorg/build/issues/289
按照他们的建议,我检查了我的“project-config.jam”,我发现
# Python configuration
import python ;
if ! [ python.configured ]
{
using python : 3.7 : /home/lowlimb/anaconda3 :/home/lowlimb/anaconda3/include/python3.7m;
}
Run Code Online (Sandbox Code Playgroud)
这是正确的,因此我真的不知道如何解决这个问题。有人可以给我一些建议吗?
我目前正在使用c ++ boost库从实时控制系统(OS:Linux)中保存一些数据。我要保存的数据是通过以下方式定义的对象:
#ifndef RECDATA_HPP
#define RECDATA_HPP
#include <vector>
template<class T>
class RecData
{
private:
std::vector<std::vector<T>> data;
std::vector<unsigned long> time;
// Allow serialization to access non-public data members.
friend class boost::serialization::access;
// Implement serialize method
template <class Archive>
void serialize(Archive &ar, const unsigned int version)
{
ar & data;
ar & time;
}
public:
std::vector<std::vector<T>> getData(){
return this->data;
}
std::vector<unsigned long> getTime(){
return this->time;
}
void PushData(std::vector<T> inData);
void PushTime(unsigned long curTime);
};
template<class T>
void RecData<T>::PushData(std::vector<T> inData){
this->data.push_back(inData);
} …Run Code Online (Sandbox Code Playgroud) 我尝试在c ++中编译一个简单的c ++代码,但是当我尝试在Windows中使用g ++编译它时,总是返回错误。
我用
g++ -std=c++0x -pthread main.cpp
Run Code Online (Sandbox Code Playgroud)
错误消息是:
std::thread' is defined in header '<thread>'; did you forget to '#include <thread>'?
Run Code Online (Sandbox Code Playgroud)
这没有意义,因为代码只是
#include<thread>
void f(int i) {}
int main() {
std::thread t(f, 1);
t.join();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我相信这段代码可以在linux上运行,我想知道为什么它不能在Windows下运行。