Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CNiTimer functions Unresolved Externals

I just added a CNiTimer derived class and I get unresolved external errors on for all the CNiTimer functions when I link. What could be causing this. In a smaller test project, I didn't have any problems. One thing that I noticed in my main project is that in File View under Mesaurement Studio->Include, the NiTimer.h file was not there and the CNiTimer class was not showing in Class View. I added the NiTimer.h file to the file list. Now the CNiTimer class shows up in CLass View but I still get the same errors when doing a clean build. What could be going on here?
Thanks,
John

0 Kudos
Message 1 of 4
(3,704 Views)
Another thing that I've noticed is that in the project that works ok, the following libraries are searched:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\NiCommonD.lib:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\NiUiCommonD.lib:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\Ni3DGraphD.lib:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\Ni4882D.lib:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\NiDataSocketD.lib:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\NiMathD.lib:
    Searching C:\Program Files\National Instruments\MeasurementStudio\VC\Lib\NiUiD.lib:

In the project that doesn't, only the NiCommonD.lib is searched and none of the others. Is that due to initial selections when I created the project using the Measurement Studio project wizard? If so, how can I add components not originally selected?

0 Kudos
Message 2 of 4
(3,698 Views)
I believe that I've solved the problem. Apparently, the components to be included are specified in the NiIncludes.h file. Once I added an include for NiUtilityComponent.h, the CNiTimer code was found in the appropriate library.

Am I right in assuming that the NiIncludes.h file is generated by the Measurement Studio Application wizard and the checked components in the wizard dialog determine which includes are part of the file? Apparently each include file specifies a set of libraries to be searched via the statement
 #pragma comment(lib, path) which puts a library search record in the object file.
0 Kudos
Message 3 of 4
(3,697 Views)
You are correct on all accounts.
 
You can use the Measurement Studio application wizards to generate an NiIncludes.h file for a new project. If you want to generate this file for an existing project, not created with a Measurement Studio application wizard, use the Add/Remove Class Libraries wizard that is available from the Measurement Studio menu.
0 Kudos
Message 4 of 4
(3,680 Views)