Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading TDM files in VS2013, C++

I am trying to use the TDM C DLL files created by NI to read and write TDM/TDX files in a C++ program in VS.

When I try and build the code calling functions in nilibddc.h, I get LNK2019 errors, saying there is an unresolved external symbol. I am not sure of the proper method to set up a link between my cpp and the lib file I am trying to call. Any advice would be appreciated.

Also trying to determine if there is a way to get TDM/TDX data editing on Cygwin instead of VS.

Thanks!
0 Kudos
Message 1 of 3
(5,064 Views)
0 Kudos
Message 2 of 3
(5,034 Views)

Actually you need two libs to be added

  • nilibddc.lib
  • user32.lib

that should resolve everything needed.

 

If you put the following lines into a batch file stored in the samples folder of the ddc lib you can compile the samples by just dragging the c file on the batch. VS140COMNTools has to be adjusted to the installed Visual studio version.

 

64 bit Visual Studio 2015 (Visual C 14) example:

 

 

@ECHO OFF

if EXIST "%VS140COMNTOOLS%\..\..\VC\bin\amd64\vcvars64.bat" (
  call "%VS140COMNTOOLS%\..\..\VC\bin\amd64\vcvars64.bat" > NUL
)
cl %1 /I "%~dp0..\dev\include" /DLL "%~dp0..\dev\lib\64-bit\msvc64\nilibddc.lib" user32.lib /Fe"%~dp0..\dev\bin\64-bit\%~n1.exe"
If NOT %ERRORLEVEL% == 0 (
  echo ERRO occured
  pause
  goto LEAVE
)

:LEAVE

32 bit Visual Studio 2010 (Visual C 10) example:

 

@ECHO OFF

if EXIST "%VS100COMNTOOLS%\vsvars32.bat" (
  call "%VS100COMNTOOLS%\vsvars32.bat"
)
cl %1 /I "%~dp0..\dev\include" /DLL "%~dp0..\dev\lib\32-bit\msvc\nilibddc.lib" user32.lib /Fe"%~dp0..\dev\bin\32-bit\%~n1.exe"
If NOT %ERRORLEVEL% == 0 (
  echo ERRO occured
  pause
  goto LEAVE
)

:LEAVE

 

0 Kudos
Message 3 of 3
(5,029 Views)