none
关于Additional Library Directories RRS feed

  • 问题

  • 大家好,我最近在看一个C++的程序,在项目属性的Linker文件夹的General页面中,Additional Library Directories里面设置的值是这样的:
    "$(SM_API_CPP_WRAPPERS)/lib";"$(SM_API_PATH)/bin"

    可是我以前自己添加的时候都是文件夹的路径啊,上面的这种表达式是什么意思?我在电脑里面也找不到这样的文件夹啊?

    2010年5月4日 14:48

答案

全部回复

  • http://support.microsoft.com/kb/311933

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2010年5月4日 17:17
    版主
  • 谢谢您的指导!不过我想再问一下,我在查看WIN7中设置的系统环境变量时,为什么有些变量的值就是一个文件名,而不是文件的路径呢?比如我安装的一个软件它设置的系统环境变量为:
    Variable: SM_API_DLL_NAME
    Value: smft31.dll

    这种没有文件路径的系统环境变量有什么意义呢?

    2010年5月5日 1:07
  • 环境变量可以是任何值。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2010年5月5日 3:17
    版主
  • 环境变量可以是任何值。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP

    那这么定义的环境变量有什么意义呢?难道我说了SM_API_DLL_NAME,系统就能知道代表smft31.dll?可是我从来没有给smft31.dll指定过路径啊?请它怎么就能直接用了?
    2010年5月5日 7:47
  • 支持环境变量软件的可以调用API取得环境变量的值。比如如果你在Visual C++的项目属性中指定$(SM_API_PATH)/bin/$(SM_API_DLL_NAME),Visual C++会把$(SM_API_DLL_NAME)替换成smft31.dll。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2010年5月5日 13:26
    版主
  • 支持环境变量软件的可以调用API取得环境变量的值。比如如果你在Visual C++的项目属性中指定$(SM_API_PATH)/bin/$(SM_API_DLL_NAME),Visual C++会把$(SM_API_DLL_NAME)替换成smft31.dll。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP


    现在问题就是我应该没有指定过任何该dll的路径啊,这个dll是安装一个API的时候自动写入"我的电脑"高级属性里的系统环境变量的,该API具体涉及到的系统环境变量有:

  • SM_API_PATH
    • Defined as the absolute path to the root folder of the faceAPI C Library.
    • Typically C:\Program Files\SeeingMachines\FaceTrackingAPI <Major.Minor>\API
  • SM_API_DLL_NAME
    • Defined as the filename of the API dll, e.g. smft31.dll
    • This is provided as the name of this DLL contains the version number and will change for minor or major releases.
  • SM_API_LIB_NAME
    • Defined as the filename of the API dll import library, e.g. smft31.lib
    • This is provided as the name of this import library contains the version number and will change for minor or major releases.
  • SM_API_CPP_WRAPPERS
    • This variable is set only if you install the faceAPI C++ Wrapper Library.
    • Defined as the absolute path to the root folder of the library.
    • Typically C:\Program Files\SeeingMachines\FaceTrackingAPI <Major.Minor>\Wrappers\C++
    • The filename of the CPP wrappers library is constant (smftcpp.lib)
  • SM_API_WIDGETS
    • This variable is set only if you install the faceAPI Qt Widget Library.
    • Defined as the absolute path to the root folder of the library.
    • Typically C:\Program Files\SeeingMachines\FaceTrackingAPI <Major.Minor>\Wrappers\Qt
    • The filename name of the Qt widget library wrappers is constant (smftqt.lib)

    您看,除了SM_API_DLL_NAME和SM_API_LIB_NAME这两个变量之外,其他变量都是有路径的啊~~~

2010年5月6日 1:25
  • VC的属性页只是做一个文本替换而已。你在命令行提示符下输入set可以看到环境变量的值。 并不是每个环境变量都需要是路径的,具体值看使用环境变量的程序怎么解读。



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2010年5月6日 3:12
    版主
  • VC的属性页只是做一个文本替换而已。你在命令行提示符下输入set可以看到环境变量的值。 并不是每个环境变量都需要是路径的,具体值看使用环境变量的程序怎么解读。



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP


    不好意思,我还是不太理解,您能再详细说说么?我发现钻牛角尖了……

    我用set命令看了发现SM_API_DLL_NAME = smft31.dll(这是系统环境变量里面的),但是在VC里的Additional Dependencies仅仅添加了$(SM_API_LIB_NAME) ,这样没有路径的话,程序怎么解读?

    2010年5月7日 1:04
  • Visual C++的属性页万恶的解读方式是替代$()里面的值为对应环境变量的值,没有用到的环境变量自然就没有用了。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2010年5月7日 2:55
    版主
  • Visual C++的属性页万恶的解读方式是替代$()里面的值为对应环境变量的值,没有用到的环境变量自然就没有用了。

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP

    也就是说,VS相当于把&(SM_API_DLL_NAME)替换成了smft31.dll,可是这个dll没有在任何地方指定过路径,也就是说,VS只是解读了$(),但是是否真正引用到了对应的dll其实是不得而知的是吗?
    2010年5月9日 4:53
  • $()里面没有引用环境变量名的话,为什么要读取环境变量的值?

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2010年5月9日 13:52
    版主