0

我已经下载了 boost 库并运行了 bootstrap.bat 和 .\b2 。尝试在 64 位上运行它我得到了这些错误

C:\cygwin\home\vickey\tunebasket\p2p>python waf build --with-tests --boost-includes="c:\boost_1_48_0" --boost-libs=
"c:\Users\vickey\Downloads\lib64\" --boost-static --boost-mt

有环境变量

Waf: Entering directory `C:\cygwin\home\vickey\tunebasket\p2p\build'
'AR' 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\LIB.exe'
'ARFLAGS' ['/NOLOGO']
'AR_TGT_F' '/OUT:'
'BINDIR' 'C:\\users\\vickey\\appdata\\local\\temp/bin'
'BOOST_VERSION' '1_48'
'CC' ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\CL.exe']
'CCLNK_TGT_F' '/OUT:'
'CC_NAME' 'msvc'
'CC_SRC_F' ''
'CC_TGT_F' ['/FC', '/c', '/Fo']
'CFLAGS' ['/nologo']
'CFLAGS_CONSOLE' ['/SUBSYSTEM:CONSOLE']
'CFLAGS_CRT_MULTITHREADED' ['/MT']
'CFLAGS_CRT_MULTITHREADED_DBG' ['/MTd']
'CFLAGS_CRT_MULTITHREADED_DLL' ['/MD']
'CFLAGS_CRT_MULTITHREADED_DLL_DBG' ['/MDd']
'CFLAGS_NATIVE' ['/SUBSYSTEM:NATIVE']
'CFLAGS_POSIX' ['/SUBSYSTEM:POSIX']
'CFLAGS_WINDOWS' ['/SUBSYSTEM:WINDOWS']
'CFLAGS_WINDOWSCE' ['/SUBSYSTEM:WINDOWSCE']
'CFLAGS_cshlib' []
'CL' ''
'COMPILER_CC' 'msvc'
'COMPILER_CXX' 'msvc'
'CPPPATH_ST' '/I%s'
'CXX' ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\CL.exe']
'CXXFLAGS' ['/nologo']
'CXXFLAGS_CONSOLE' ['/SUBSYSTEM:CONSOLE']
'CXXFLAGS_CRT_MULTITHREADED' ['/MT']
'CXXFLAGS_CRT_MULTITHREADED_DBG' ['/MTd']
'CXXFLAGS_CRT_MULTITHREADED_DLL' ['/MD']
'CXXFLAGS_CRT_MULTITHREADED_DLL_DBG' ['/MDd']
'CXXFLAGS_NATIVE' ['/SUBSYSTEM:NATIVE']
'CXXFLAGS_POSIX' ['/SUBSYSTEM:POSIX']
'CXXFLAGS_WINDOWS' ['/SUBSYSTEM:WINDOWS']
'CXXFLAGS_WINDOWSCE' ['/SUBSYSTEM:WINDOWSCE']
'CXXFLAGS_cxxshlib' []
'CXXLNK_TGT_F' '/OUT:'
'CXX_NAME' 'msvc'
'CXX_SRC_F' ''
'CXX_TGT_F' ['/FC', '/c', '/Fo']
'DEFINES' []
'DEFINES_ST' '/D%s'
'DEST_BINFMT' 'pe'
'DEST_OS' 'win32'
'IMPLIB_ST' '/IMPLIB:%s'
'INCLUDES' ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE', 'C:\\Program Files (x86)\\Microso
ft SDKs\\Windows\\v7.0A\\include']
'INCLUDES_BOOST' 'c:\\boost_1_48_0'
'LIBDIR' 'C:\\users\\vickey\\appdata\\local\\temp/lib'
'LIBPATH' ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB', 'C:\\Program Files (x86)\\Microsoft SD
Ks\\Windows\\v7.0A\\lib']
'LIBPATH_ST' '/LIBPATH:%s'
'LIB_ST' '%s.lib'
'LINK' 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\LINK.exe'
'LINKFLAGS' ['/NOLOGO', '/MANIFEST']
'LINKFLAGS_cshlib' ['/DLL']
'LINKFLAGS_cstlib' []
'LINKFLAGS_cxxshlib' ['/DLL']
'LINK_CC' 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\LINK.exe'
'LINK_CXX' 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\LINK.exe'
'MSVC_COMPILER' 'msvc'
'MSVC_INSTALLED_VERSIONS' [('msvc 10.0Exp', [('x86', ('x86', (['C:\\Program Files (x86)\\Microsoft Visual Studio 10
.0\\Common7\\IDE\\', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN', 'C:\\Program Files (x86)\\Mi
crosoft Visual Studio 10.0\\Common7\\Tools', 'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319', 'C:\\Windows\\Mic
rosoft.NET\\Framework\\v3.5', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\VCPackages', 'C:\\Program
 Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETFX 4.0 Tools', 'C:\\Program Files (x86)\\Microsoft SDKs\\Wind
ows\\v7.0A\\bin', 'c:\\Python27\\lib\\site-packages\\gtk-2.0\\runtime\\bin', 'C:\\Program Files (x86)\\Git\\bin', '
C:\\shortcuts', 'C:\\Program Files (x86)\\Vim\\vim73\\', 'C:\\OSSBuild\\GStreamer\\v0.10.7\\sdk\\bin', 'C:\\OSSBuil
d\\GStreamer\\v0.10.7\\bin', 'C:\\Windows\\system32', 'C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\S
ystem32\\WindowsPowerShell\\v1.0\\', 'C:\\Program Files (x86)\\OpenSSH\\bin', 'c:\\Python27\\', 'C:\\Program Files
(x86)\\GnuWin32\\bin', '', 'C:\\GTK2\\2.0\\bin', 'C:\\cygwin\\bin\\mintty.exe', 'C:\\libglade'], ['C:\\Program File
s (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE', 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\incl
ude'], ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB', 'C:\\Program Files (x86)\\Microsoft SDKs\
\Windows\\v7.0A\\lib'])))]), ('msvc 10.0', [('x86', ('x86', (['C:\\Program Files (x86)\\Microsoft Visual Studio 10.
0\\Common7\\IDE\\', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN', 'C:\\Program Files (x86)\\Mic
rosoft Visual Studio 10.0\\Common7\\Tools', 'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319', 'C:\\Windows\\Micr
osoft.NET\\Framework\\v3.5', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\VCPackages', 'C:\\Program
Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETFX 4.0 Tools', 'C:\\Program Files (x86)\\Microsoft SDKs\\Windo
ws\\v7.0A\\bin', 'c:\\Python27\\lib\\site-packages\\gtk-2.0\\runtime\\bin', 'C:\\Program Files (x86)\\Git\\bin', 'C
:\\shortcuts', 'C:\\Program Files (x86)\\Vim\\vim73\\', 'C:\\OSSBuild\\GStreamer\\v0.10.7\\sdk\\bin', 'C:\\OSSBuild
\\GStreamer\\v0.10.7\\bin', 'C:\\Windows\\system32', 'C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\Sy
stem32\\WindowsPowerShell\\v1.0\\', 'C:\\Program Files (x86)\\OpenSSH\\bin', 'c:\\Python27\\', 'C:\\Program Files (
x86)\\GnuWin32\\bin', '', 'C:\\GTK2\\2.0\\bin', 'C:\\cygwin\\bin\\mintty.exe', 'C:\\libglade'], ['C:\\Program Files
 (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE', 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\inclu
de'], ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB', 'C:\\Program Files (x86)\\Microsoft SDKs\\
Windows\\v7.0A\\lib'])))])]
'MSVC_MANIFEST' True
'MSVC_VERSION' 10.0
'MT' 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\MT.exe'
'MTFLAGS' ['/NOLOGO']
'PATH' ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\', 'C:\\Program Files (x86)\\Microsof
t Visual Studio 10.0\\VC\\BIN', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools', 'C:\\Windo
ws\\Microsoft.NET\\Framework\\v4.0.30319', 'C:\\Windows\\Microsoft.NET\\Framework\\v3.5', 'C:\\Program Files (x86)\
\Microsoft Visual Studio 10.0\\VC\\VCPackages', 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETF
X 4.0 Tools', 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin', 'c:\\Python27\\lib\\site-packages\\gt
k-2.0\\runtime\\bin', 'C:\\Program Files (x86)\\Git\\bin', 'C:\\shortcuts', 'C:\\Program Files (x86)\\Vim\\vim73\\'
, 'C:\\OSSBuild\\GStreamer\\v0.10.7\\sdk\\bin', 'C:\\OSSBuild\\GStreamer\\v0.10.7\\bin', 'C:\\Windows\\system32', '
C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\', 'C:\\Program Files
 (x86)\\OpenSSH\\bin', 'c:\\Python27\\', 'C:\\Program Files (x86)\\GnuWin32\\bin', '', 'C:\\GTK2\\2.0\\bin', 'C:\\c
ygwin\\bin\\mintty.exe', 'C:\\libglade']
'PREFIX' 'C:\\users\\vickey\\appdata\\local\\temp'
'STLIBPATH_BOOST' ['c:\\Users\\vickey\\Downloads\\lib64']
'STLIBPATH_ST' '/LIBPATH:%s'
'STLIB_BOOST' ['boost_unit_test_framework-vc100-mt-1_48']
'STLIB_ST' 'lib%s.lib'
'WINRC' 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\RC.exe'
'WINRCFLAGS' []
'WINRC_SRC_F' ''
'WINRC_TGT_F' '/fo'
'cfg_files' ['C:\\cygwin\\home\\vickey\\tunebasket\\p2p\\build\\config.h']
'commonCFlags' ['/EHsc', '/MD']
'commonCxxFlags' ['/EHsc', '/MD']
'commonLinkFlags' []
'cprogram_PATTERN' '%s.exe'
'cshlib_PATTERN' '%s.dll'
'cstlib_PATTERN' 'lib%s.lib'
'cxxprogram_PATTERN' '%s.exe'
'cxxshlib_PATTERN' '%s.dll'
'cxxstlib_PATTERN' 'lib%s.lib'
'define_key' []
'implib_PATTERN' '%s.lib'
'projectDir' 'C:\\\\cygwin\\\\home\\\\vickey\\\\tunebasket\\\\p2p'

编译输出

dbPath C:\cygwin\home\vickey\tunebasket\p2p\src\Database
dbPath1 C:\cygwin\home\vickey\tunebasket\p2p\src\Database\util
[ 7/16] cxx: src\Repository\Song.cpp -> build\src\Repository\Song.cpp.1.o
[ 9/16] cxx: src\Repository\Songs.cpp -> build\src\Repository\Songs.cpp.2.o
Songs.cpp
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocale(323) : warning C4530: C++ exception handler
used, but unwind semantics are not enabled. Specify /EHsc
c:\cygwin\home\vickey\tunebasket\p2p\src\database\vectoriterator.h(4) : fatal error C1083: Cannot open include file
: 'boost/iterator/iterator_facade.hpp': No such file or directory
Song.cpp
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocale(323) : warning C4530: C++ exception handler
used, but unwind semantics are not enabled. Specify /EHsc
c:\cygwin\home\vickey\tunebasket\p2p\src\database\typedefs.h(4) : fatal error C1083: Cannot open include file: 'boo
st/shared_ptr.hpp': No such file or directory
Waf: Leaving directory `C:\cygwin\home\vickey\tunebasket\p2p\build'
Build failed
 -> task in 'Songs.o' failed (exit status 2):
        {task 40568720: cxx Songs.cpp -> Songs.cpp.2.o}
['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\CL.exe', '/nologo', '/IC:\\Program Files (x86)\\M
icrosoft Visual Studio 10.0\\VC\\INCLUDE', '/IC:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include', ''
, '..\\src\\Repository\\Songs.cpp', '/FC', '/c', '/Fo', 'src\\Repository\\Songs.cpp.2.o']
 -> task in 'Song.o' failed (exit status 2):
        {task 40568368: cxx Song.cpp -> Song.cpp.1.o}
['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\CL.exe', '/nologo', '/IC:\\Program Files (x86)\\M
icrosoft Visual Studio 10.0\\VC\\INCLUDE', '/IC:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include', ''
, '..\\src\\Repository\\Song.cpp', '/FC', '/c', '/Fo', 'src\\Repository\\Song.cpp.1.o']

但是这些头文件存在于 boost 主目录中。对于 64 位系统,boost 库是否必须进行不同的编译?

4

2 回答 2

0

查看环境变量后,我发现该INCLUDES变量没有 Boost 包含路径:

'INCLUDES' ['C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE', 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include']
'INCLUDES_BOOST' 'c:\\boost_1_48_0'

INCLUDES_BOOST变量确实如此。我似乎记得应该是BOOST_INCLUDES。检查您是否正确初始化了 waf boost 工具。

如果这不起作用,请尝试在正常包含路径中设置 Boost 包含路径以查看是否找到它们。如果是这样,那么您就知道它是 waf boost 工具的问题,或者它是如何使用的。并尝试执行 waf 并设置详细程度以查看其传递给编译器的包含路径。

如果失败,则可能是前面评论中提到的路径分隔符问题。这是一个让我担心的例子,注意 '\' 和 '/' 都被使用了:

'LIBDIR' 'C:\\users\\vickey\\appdata\\local\\temp/lib'
于 2012-05-28T14:16:39.260 回答
0

您似乎忘记在任务生成器声明中使用 use='BOOST',这就是为什么没有将 boost 包含添加到编译行的原因。

于 2012-06-17T16:11:52.010 回答