gpt4 book ai didi

c++ - 在cygwin错误下 boost

转载 作者:行者123 更新时间:2023-11-28 07:59:19 26 4
gpt4 key购买 nike

命令行是

g++ -c -Wall -I "C:/cygwin/usr/include/" test.cpp

这是错误信息:

C:/cygwin/usr/include/stdint.h:62:22: error: conflicting declaration 'typedef unsigned int uintptr_t'
c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/_mingw.h:352:44: error: 'uintptr_t' has a previous declaration as 'typedef long long unsigned int uintptr_t'
In file included from C:/cygwin/usr/include/boost/assert.hpp:81:0,
from C:/cygwin/usr/include/boost/system/error_code.hpp:16,
from C:/cygwin/usr/include/boost/filesystem/v3/path_traits.hpp:23,
from C:/cygwin/usr/include/boost/filesystem/v3/path.hpp:25,
from C:/cygwin/usr/include/boost/filesystem.hpp:35,

c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/cstdlib:195:11: error: '::strtold' has
not been declared
c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/cstdlib:215:22: error: '__gnu_cxx::str
told' has not been declared
In file included from c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/bits/postypes.h:
42:0,
from c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/iosfwd:42,
from c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/ios:39,
from c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/ostream:40,
from c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/c++/4.5.2/iostream:40,
from C:/cygwin/usr/include/boost/assert.hpp:82,
from C:/cygwin/usr/include/boost/system/error_code.hpp:16,
from C:/cygwin/usr/include/boost/filesystem/v3/path_traits.hpp:23,
from C:/cygwin/usr/include/boost/filesystem/v3/path.hpp:25,
from C:/cygwin/usr/include/boost/filesystem.hpp:35,

任何帮助,我不明白为什么要检查 python27 目录。

最佳答案

看起来 python27 文件夹包含 mingw - 这是 cygwin 的替代品。可能默认 header 搜索路径设置为 mingw 的目录 (c:/python27/egg-info/mingw/usr/lib/gcc/../../x86_64-w64-mingw32/include/).

检查是否设置了以下环境变量:

CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH

你也可以尝试编译:1)-nostdinc选项忽略默认包含目录2) -v 到详细的g++ 输出

关于c++ - 在cygwin错误下 boost ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11916236/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com