技术标签: path python build preprocessor documentation module
There is one build error when building boost 1.46 + python 3.2 via VC++ 2008:
libs/python/src/converter/builtin_converters.cpp(436) : error C2664: 'PyUnicodeUCS2_AsWideChar' : cannot convert parameter 1 from 'PyUnicodeObject *' to 'PyObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Solution: change libs/python/src/converter/builtin_converters.cpp(436)
static std::wstring extract(PyObject* intermediate)
{
std::wstring result(::PyObject_Length(intermediate), L' ');
if (!result.empty())
{
int err = PyUnicode_AsWideChar(
/*(PyUnicodeObject *)*/intermediate // change this line, comment out the C style cast!!!
, &result[0]
, result.size());
if (err == -1)
throw_error_already_set();
}
return result;
}
Note: I also append the following to D:/opensource/boost_1_46_0/tools/build/v2/user-config.jam
###########################################################
using python
: 3.2 # Version
: C://Python32//python.exe # Python Path
: C://Python32//Include # include path(s) -they may be not really needed here
: C://Python32//libs # lib path(s) - they may be not really needed here
: <python-debugging>off <define>BOOST_ALL_NO_LIB=1
;
using python
: 3.2 # Version
: C://Python32//python.exe # Python Path
: C://Python32//Include # include path(s) -they may be not really needed here
: C://Python32//libs # lib path(s) - they may be not really needed here
: <python-debugging>on <define>BOOST_ALL_NO_LIB=1
;
###########################################################
I also need to modify the following line in D:/src/boost_1_46_0/libs/python/src/module.cpp
BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef& moduledef, void(*init_function)())
Otherwise there is a link error:
error LNK2001: unresolved external symbol "__declspec(dllimport) struct _object * __cdecl boost::python::detail::init_module(struct PyModuleDef &,void (__cdecl*)(void))" ([email protected]@[email protected]@@[email protected]@[email protected]@[email protected])
boost.log is only compatible with boost.filesystem v2, but boost 1.46 is using boost.filesystem v3 by default.
compile-c-c++ bin.v2/libs/log/build/msvc-10.0/release/link-static/runtime-link-static/threading-multi/text_file_backend.obj
text_file_backend.cpp
./boost/log/detail/universal_path.hpp(46) : error C2039: 'external_string_type' : is not a member of 'boost::filesystem3::path'
The following command can be used to build boost.log.
bjam.exe --with-log --toolset=msvc stage --build-type=complete define=BOOST_FILESYSTEM_VERSION=2
I created a batch file to build the boost library.
rem call "%VS100COMNTOOLS%/../../vc/bin/vcvars32.bat"
call "%VS90COMNTOOLS%/../../VC/vcvarsall.bat"
cd /d D:/opensource/boost_1_46_0
echo Update D:/opensource/boost_1_46_0/tools/build/v2/user-config.jam
call bootstrap.bat
set ICU_PATH=D:/opensource/icu4c-4_6-src/icu
echo "build start" >> buildtime.txt
time /t >> buildtime.txt
bjam.exe --toolset=msvc stage --build-type=complete -sBZIP2_SOURCE=D:/opensource/bzip2-1.0.5 -sZLIB_SOURCE=D:/opensource/zlib-1.2.5 -sICU_PATH="D:/opensource/icu4c-4_4_1-Win32-msvc9/icu" >> msvc10.log
time /t >> buildtime.txt
echo "build finished" >> buildtime.txt
Use boost.log in DLL
When I am using boost.log in DLL, the Debug configuration will raise the following error:
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: E:/svn/trunk/Debug/Onegad.exe
File: f:/dd/vctools/vc7libs/ship/atlmfc/src/mfc/dllinit.cpp
Line: 587
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
compile with Intel C++ compiler
C:/tmp/boost_1_35_0/libs/program_options/build>../../../bjam.exe --toolset=intel release
C:/tmp/boost_1_35_0/libs/program_options/build>../../../bjam.exe --toolset=intel
C:/tmp/boost_1_35_0/libs/program_options/build>../../../bjam.exe --toolset=intel link=static debug release
编写服务器端程序: 1.创建一个服务器套接字(ServerSocket),绑定到指定端口; 2.调用accep方法,侦听来自客户端的请求,如果客户发出的请求,则接受连接,返回通信套接字Socket; 3.调用Socket的getInputStream和getOutputStream方法,获得输入/输出流,开始网络数据的接收和发送; 4.关闭通信套接字,关闭服务器套接字;示例代码如下:pack
本文来自我的微信公众号【古德曼汽车工业】欢迎大家关注需要解决什么问题?动力连参数优化 动力链匹配期间,经常会遇到主减速优化,变速箱速比优化,甚至换挡策略优化这类寻找最优值的问题。项目要求性能匹配工程师,根据已经确定的动力性指标,找到一组经济性最优的配置。逻辑阈值的优化 另外由于目前新能源汽车的能量管理策略大部分是基于逻辑门开发的。所以这样的控制策略中就会有非常多的判断阈值,如:并联驱动...
在安装laravel项目后,首次打开laravel出现解决方案:1.打开配置文件 laravel/config/app.php3.找到 'debug'项 设置为 true4.刷新网页 抛出运行异常:No application encryption key has been specified.(未指定应用加密密钥)5.在laravel下找到 .env.exam...
dbc.driverClassName=com.mysql.jdbc.Driverjdbc.url=jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=utf8&autoReconnect=true&rewriteBatchedStatements=TRUEjdbc.username=...
所有的web开发都是【请求】+【响应】推荐JavaScript中使用单引号引用字符串,HTML中使用双引号,防止冲突JavaScript代码、网页代码执行顺序是从上到下依次执行<noscript></noscript>标签,在浏览器不支持JavaScript内容时会展示noscript标签内的内容<...
iOS9中默认非https是被禁止的不过可以设置App Transport Security Settings下的Allow Arbitrary Loads设置为YES即可,iOS10以后就不行了,强制我们使用https,提交App的话会遭到拒绝,需要在App Transport Security Settings添加一个属性,Exception Domain设置域,也就是把不支持
链接:点击打开链接题意:有M个机器(代表一天可以同时干M天的工作),有N个任务。每个任务必须在Si或者以后开始做,在Ei或者之前完成,完成每个任务必须处理Pi个时间单位,问最后是否可以完成这N个任务代码:#include #include #include #include #include #include #include using namespace std;con
Google官方网站:Audio Hal 适配: https://source.android.google.cn/devices/audio/aaudioAAudio 上层应用使用说明:https://developer.android.google.cn/ndk/guides/audio/aaudio/aaudioAAudio API说明文档:https://developer.andr...
随着自动驾驶大规模商业化落地的技术路径逐步明朗,包括大众、奔驰、上汽、长城、长安、一汽等越来越多车企在加快下一代整车技术架构的规划。在这当中,越来越多车企放弃选择过去打包的整体选择方案,而是在软件、数据、操作系统等核心环节追求更多的自定义能力。比如在自动驾驶领域,包括车企、无人驾驶出行服务商等都对掌握自动驾驶相关的系统、算法和数据需求非常迫切。但是,全球自动驾驶的技术路径众多,从底层OS、计算平台、顶层算法等均存在差异化,这就需要一个高度扩展性、兼容性和灵活性的自动驾驶平台进行适配。在202
3-1.大于身高的平均值 (10 分)中小学生每个学期都要体检,要量身高,因为身高可以反映孩子的生长状况。现在,一个班的身高已经量好了,请输出其中超过平均身高的那些身高。程序的输入为一行数据,其中以空格分隔,每个数据都是一个正整数。程序要输出那些超过输入的正整数的平均数的输入值,每个数后面有一个空格,输出的顺序和输入的相同。输入格式:在一行输入中一个班的身高值,以空格分隔。输出格式:在一...
#include &lt;stdio.h&gt;#include &lt;dirent.h&gt;#include &lt;stdlib.h&gt;#include &lt;string.h&gt;#include &lt;sys/types.h&gt;#include &lt;sys/stat.h&gt; int main(int argc, char const *argv[])...
Python是一门不需要编译的语言,在cmd使用Python xxx.py即可运行部分参考了博客https://baijiahao.baidu.com/s?id=1607395511044728085&wfr=spider&for=pc1、版本问题在网上看初学资料,发现网上大部分资料都是python2的教学资料,而发现自己下载安装的是python3。所以在跟着写代...