创建TestStand Visual C++ 项目DBLog中编译器和链接器的错误



主要软件:
主要软件版本: 2.0.1
主要软件修正版本: N/A
次要软件: N/A

问题: National Instruments为位于<TestStand>\Components\NI\Models\TestStandModels\Database\DBLog的DBLOG项目中数据库日志功能,提供Microsoft Visual C++ 6.0的源代码。我尝试使用自定义的TestStand数据库记录;但是,甚至在没有修改的情况下,由于编译和链接错误,我无法编译项目。为什么项目不可以编译?

解答:

你可能遇到如下错误:

错误— 编译器错误在StdAfx.h,34行以及Std.cpp, 12行, 比如:
C:\TestStand\Components\NI\Models\TestStandModels\Database\DBLog\stdafx.h(34) : fatal error C1083: Cannot open type library file: C:\Program Files\National Instruments\Session Manager\NISessionServer.dll: No such file or directory.

解决方法—你需要更改这些源代码行定义的路径以指向NI会话管理器定义的新的路径:

C:\Program Files\National Instruments\Shared\Session Manager\NISessionServer.dll.

错误—与链接器不能在应该定义在命名空间'TS'里找到特定的符号相关的错误。例如,在编译TestStand2.0.1这个项目的时候,你可能会得到如下错误:

C:\TestStand\Components\User\Models\TestStandModels\Database\DBLog\TSDatalink.cpp(67) : error C2039: 'PropOption_InsertIfMissing': is not a member of 'TS'.

解决方法—这个问题是Microsoft Visual C++ 6.0为了建立两个包含TestStand's teapi.dll模块的ActiveX接口而在包含在DLL的类型库里面读取时候产生的。这个问题在 Visual Studio 6.0 Service Pack 3或者更高版本后被解决。在本文最后的链接下载 Visual Studio 6.0 Service Pack 3以更新。在你安装好SP3以后,你的项目应该可以正常编译。

错误—甚至在安装好最新版本的Visual Studio 6.0 service pack后,在编译TestStand 3.0的DBLog项目时候,你可能得到如下的错误信息,表明Mutex.cppMutex.h不存在:

  • Fatal error C1083: Cannot open source file: 'C:\Program Files\National Instruments\TestStand 3.0\Components\NI\Models\TestStandModels\Database\DBLog\Mutex.cpp': No such file or directory
  • C:\Program Files\National Instruments\TestStand 3.0\Components\NI\Models\TestStandModels\Database\DBLog\TSDatalink.cpp(6): fatal error C1083: Cannot open include file: 'Mutex.h': No such file or directory
  • C:\Program Files\National Instruments\TestStand 3.0\Components\NI\Models\TestStandModels\Database\DBLog\TSDBLog.cpp(5): fatal error C1083: Cannot open include file: 'Mutex.h': No such file or directory
  • Solution—这些文件未分配到TestStand3.0中,但是可以在本文档末尾部分的附件部分进行下载。把这两个文件放在你收到的错误编译信息提示的路径下面,然后你应该可以成功的编译DBLog项目了。

     





    相关链接: Microsoft Visual Studio 6.0 Service Pack 6
    Microsoft Knowledge Base Article 316915: How to Determine If Visual Studio 6.0 Service Pack 3 or Higher Is Installed
    KnowledgeBase 39DC10U: Compiler Errors When Building the TestStand 3.0 Visual C++ Operator Interfaces

    附件:


    Mutex.h - Mutex.hMutex.cpp - Mutex.cpp


    报告日期: 10/14/2003
    最近更新: 09/03/2013
    文档编号: 32DEQURY