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
(4,496 Views)

Hello,

 

Have you seen these resources for your specific error/issue?

 

http://digital.ni.com/public.nsf/allkb/A3663DE39D6A2C5A86257204005C11CA

http://www.ni.com/white-paper/3341/en/#toc9

http://www.ni.com/white-paper/2824/en/

 

http://forums.ni.com/t5/DIAdem/Linking-error-when-using-C-DLL-for-writing-TDM-files/td-p/1112024

 

Please let me know if these links are useful.  

 

Thanks,

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,466 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
(4,461 Views)