StupidBeauty
Read times:1146Posted at:Mon Jan 28 21:43:32 2013
- no title specified

转载 Error building Boost 1.49.0 with GCC 4.7.0

Python的一个漏洞导致 使用MinGW来编译包含过pyconfig.h头文件的c++源代码时 会出现“ lib/gcc/i686-pc-mingw32/4.7.2/../../../../include/c++/4.7.2/cmath:1096:11: error: '::hypot' has not been declared ”的错误。绕过方法 就是在c++文件里将 #include <cmath> 提到所有包含头文件指令的最前面。

http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0

亮点:

Found the answer in this forum post . It seems that pyconfig.h has the following lines:

#if defined(__GNUC__) && defined(_WIN32)

// ...

#define hypot _hypot

// ...

#endif /* GNUC */

but cmath included with MinGW expects the function to be named hypot and not _hypot, which causes the compilation errors.

The fix was to include the following to my bjam command line's cxxflags option

bjam ... cxxflags="-include cmath "

This indicates that g++ should include the cmath header at the beginning of every source file.

杂乱

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4