如何让bjam在其他目录中找到我的.h文件

时间:2012-05-17 23:37:05

标签: visual-studio bjam

我在Visual Studio 2008中维护此解决方案,但我使用bjam构建了可交付成果。 该解决方案包括3个项目。 jamfiles设置为构建解决方案的2个版本(比如A和B),然后为每个版本构建32位和64位可执行文件。

我的问题是bjam没有找到解决方案中某个项目的.h文件,产生下面的错误。这些.h文件实际上位于2个目录中,一个位于“include”文件夹中。

如果我将.h文件复制到项目的jamfile所在的位置,则错误消失,解决方案构建完美。但是,我们必须将.h文件保存在“include”文件夹中。

我的问题是,如何指示bjam在“include”文件夹中查找.h文件? 下面是有问题的项目的jamfile,以及我的site-config.jam文件

任何提示都将非常感激。谢谢。

    -----------------------------------
    ERROR:
    compile-c-c++ Utilities\TemperatureLog\bin\msvc-9.0\small_x86\threading-multi\user-interface-gui\TemperatureLog.obj
    TemperatureLog.cpp
    c:\winirdir\build\winir\utilities\temperaturelog\TemperatureLogDlg.h(50) : error C2653: 'SBF' : is not a class or namespace name
    c:\winirdir\build\winir\utilities\temperaturelog\TemperatureLogDlg.h(50) : error C2143: syntax error : missing ';' before '*'
    c:\winirdir\build\winir\utilities\temperaturelog\TemperatureLogDlg.h(50) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    c:\winirdir\build\winir\utilities\temperaturelog\TemperatureLogDlg.h(50) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    ------------------------------------------

的Jamfile:

project temperaturelog :
    : requirements <define>_AFXDLL
        <user-interface>gui
    :
    ;

sources = [ glob *.cpp ] TemperatureLog.rc ;

exe TemperatureLog$(suffix) : $(sources)
        /sbfsdk//SbfSdk$(suffix)
    : 
    : small_x86
    ;

exe TemperatureLog$(suffix)_x64 : $(sources)
        /sbfsdk//SbfSdk$(suffix)_x64
    : 
    : small_x64
    ;

exe TemperatureLog$(suffix)_sap : $(sources)
        /sbfsdk//SbfSdk$(suffix)_sap
    :
    : smallSapera_x86
    ;

exe TemperatureLog$(suffix)_sap_x64 : $(sources)
        /sbfsdk//SbfSdk$(suffix)_sap_x64
    :
    : smallSapera_x64
    ;

install dist_x86 : TemperatureLog$(suffix) : 
    <variant>small_x86 : <location>$(installRoot_x86) ;

install dist_x64 : TemperatureLog$(suffix)_x64 :
    <variant>small_x64 : <location>$(installRoot_x64) ;

install dist_sap_x86 : TemperatureLog$(suffix)_sap :
    <variant>smallSapera_x86 : <location>$(installRoot_x86) ;

install dist_sap_x64 : TemperatureLog$(suffix)_sap_x64 :
    <variant>smallSapera_x64 : <location>$(installRoot_x64) ;

--------------------------------

site-config.jam

project site-config ;

path-constant BoostRoot : C:/Boost/boost_1_44_0 ;

lib shlwapi : : <name>shlwapi ;
lib advapi32 : : <name>advapi32 ;
lib gdi32 : : <name>gdi32 ;
lib user32  : : <name>user32 ;
lib ole32 : : <name>ole32 ;
lib vfw32 : : <name>vfw32 ;
lib delayimp : : <name>delayimp ;
lib gdiplus : : <name>gdiplus ;
lib strmiids : : <name>strmiids ;
lib winmm : : <name>winmm ;
lib msvcrt : : <name>msvcrt ;
lib atls : : <name>atls ;
lib ksproxy : : <name>ksproxy ;
lib kernel32 : : <name>kernel32 ;
lib oleaut32 : : <name>oleaut32 ;
lib uuid : : <name>uuid ;
lib htmlhelp : : <name>htmlhelp ;
lib version : : <name>version ;
lib msi : : <name>msi ;

path-constant PleoraRoot : "C:/Program Files (x86)/Pleora Technologies Inc/iPORT Software" ;
lib cyutilslib_x86 : : <name>CyUtilsLib <search>$(PleoraRoot)/Libraries
    :
    : <include>$(PleoraRoot)/Includes
    ;
lib cyutilslib_x64 : : <name>CyUtilsLib64 <search>$(PleoraRoot)/Libraries
    :
    : <include>$(PleoraRoot)/Includes
    ;

path-constant PdvRoot : "C:/EDT/pdv" ;
lib pdvlib_x86 : : <name>pdvlib <search>$(PdvRoot)/lib/x86
    :
    : <include>$(PdvRoot)
    ;
lib pdvlib_x64 : : <name>pdvlib <search>$(PdvRoot)/lib/amd64
    :
    : <include>$(PdvRoot)
    ;

path-constant VceRoot : "C:/Program Files/Imperx/FrameLink Express/SDK" ;
lib vceclb_x86 : : <name>vceclb <search>$(VceRoot)/lib/win32
    :
    : <include>$(VceRoot)/inc
    ;
lib vceclb_x64 : : <name>vceclb <search>$(VceRoot)/lib/x64
    :
    : <include>$(VceRoot)/inc
    ;

path-constant DirectXRoot : "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)" ;
lib d3dx9_x86 : : <name>d3dx9 <search>$(DirectXRoot)/Lib/x86
    :
    : <include>$(DirectXRoot)/Include
    ;
lib d3dx9_x64 : : <name>d3dx9 <search>$(DirectXRoot)/Lib/x64
    :
    : <include>$(DirectXRoot)/Include
    ;
lib d3d9_x86 : : <name>d3d9 <search>$(DirectXRoot)/Lib/x86
    :
    : <include>$(DirectXRoot)/Include
    ;
lib d3d9_x64 : : <name>d3d9 <search>$(DirectXRoot)/Lib/x64
    :
    : <include>$(DirectXRoot)/Include
    ;

path-constant IfcRoot : "C:/IFC510" ;
lib ifc21 : : <name>ifc21 <search>$(IfcRoot)/lib
    :
    : <include>$(IfcRoot)/include
    ;

path-constant PythonRoot : "C:/Required_Binaries/Python-2.7.1" ;
lib python_x86 : : <name>python27 <search>$(PythonRoot)/PCBuild
    :
    : <include>$(PythonRoot)/Include <include>$(PythonRoot)/PC
    ;
lib python_x64 : : <name>python27 <search>$(PythonRoot)/PCBuild/amd64
    :
    : <include>$(PythonRoot)/Include <include>$(PythonRoot)/PC
    ;

# path-constants work up to here, but not after this, so we use the full path.  Why??
path-constant DirectShowRoot : "C:/Program Files/Microsoft SDKs/Windows/v7.0/Samples/multimedia/directshow/baseclasses" ;
lib Strmbase_x86 : : <name>strmbase <search>"C:/Program Files/Microsoft SDKs/Windows/v7.0/Samples/multimedia/directshow/baseclasses/Release_MBCS"
    :           
    : <include>$(DirectShowRoot)
    ;
lib Strmbase_x64 : : <name>strmbase <search>"C:/Program Files/Microsoft SDKs/Windows/v7.0/Samples/multimedia/directshow/baseclasses/x64/Release_MBCS"
    :           
    : <include>$(DirectShowRoot)
    ;

path-constant SaperaRoot : "C:/DALSA/Sapera" ;
lib SapClassBasic_x86 : : <name>SapClassBasic <search>"C:/Dalsa/Sapera/Lib/Win32"
    :           
    : <include>$(SaperaRoot)/Classes/Basic <include>$(SaperaRoot)/Include
    ;
lib SapClassBasic_x64 : : <name>SapClassBasic <search>"C:/Dalsa/Sapera/Lib/Win64"
    :           
    : <include>$(SaperaRoot)/Classes/Basic <include>$(SaperaRoot)/Include
    ;

path-constant SbfSdkInc  : "C:\WinIRDir\build\WinIR\SbfSdk\include" ;

path-constant ActRoot : "C:/Program Files (x86)/Active Silicon/Phoenix/Win/SDK6.47" ;
lib ActiveSilicon_x86 : : <name>phxlw32 <search>$(ActRoot)/Lib/win32
     :
     : <include>$(ActRoot)/Include
     ;
lib ActiveSilicon_x64 : : <name>phxlx64 <search>$(ActRoot)/Lib/win64
     :
     : <include>$(ActRoot)/Include
     ;

1 个答案:

答案 0 :(得分:2)

使用您的第一个exe规则尝试类似的事情:

exe TemperatureLog$(suffix)
    : $(sources)
      /sbfsdk//SbfSdk$(suffix)
    : <include>../../include
    : small_x86
    ;

可以找到更多详细信息here

如果可行,那么您可以将其移至exe规则,而不是为每个project规则复制它,而不是:{/ p>

project temperaturelog
    : requirements
      <define>_AFXDLL
      <user-interface>gui
      <include>../../include
    ;

然后它应该适用于作为该项目的一部分调用的所有规则。