错误的建筑升压1.49.0与海湾合作委员会4.7.0 [英] Error building Boost 1.49.0 with GCC 4.7.0
问题描述
我试图建立使用GCC 4.7.0(MinGW的)升压1.49.0。我不断收到以下错误消息数十倍:
I'm trying to build Boost 1.49.0 using GCC 4.7.0 (MinGW). I keep getting the following error message several dozen times:
C:\\工具\\ MinGW的\\ BIN ../ lib中/ GCC / i686的-PC-的mingw32 / 4.7.0 /../../../../包括/ C ++ / 4.7.0 / CMATH: 1096:11:错误:':: hypot尚未声明
c:\tools\mingw\bin../lib/gcc/i686-pc-mingw32/4.7.0/../../../../include/c++/4.7.0/cmath:1096:11: error: '::hypot' has not been declared
1096行 CMATH
包含
using ::hypot;
CMATH
包括文件math.h
该声明 hypot
功能
extern double __cdecl hypot (double, double); /* in libmoldname.a */
在这两个文件,一对夫妇上面引述的那些后线,都为 hypotl
功能相同的语句(除了类型长双
而不是双击
)和一个似乎高兴。
In both files, a couple of lines after the ones quoted above, are identical statements for the hypotl
function (except the type is long double
instead of double
) and that one seems happy.
任何想法,为什么我收到此错误?
Any ideas why I am getting this error?
推荐答案
发现在<一个答案href=\"http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-tp3165793p3166757.html\">this论坛帖子。看来的 pyconfig.h 的有下面几行:
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 */
不过的 CMATH 的包含MinGW的希望被命名的函数 hypot
,而不是 _hypot
,这会导致编译错误。
but cmath included with MinGW expects the function to be named hypot
and not _hypot
, which causes the compilation errors.
此修复程序是包括以下我的bjam命令行的 CXXFLAGS 的选项
The fix was to include the following to my bjam command line's cxxflags option
bjam ... cxxflags="-include cmath "
这表明G ++应包括的 CMATH 的每个源文件的开头报头
This indicates that g++ should include the cmath header at the beginning of every source file.
这篇关于错误的建筑升压1.49.0与海湾合作委员会4.7.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!