10-12-2008 12:19 PM
I am using the Borland BCC55 compiler on a Windows XP computer. I have put the NIDAQmx.lib in C:\Borland\BCC55\Lib and I have put NIDAQmx.h in C:\Borland\BCC55\Include.
Here is the output that I get from the compiler:
C:\Borland\BCC55\Bin>bcc32 -IC:\Borland\bcc55\include -LC:\Borland\bcc55\Lib tes
2.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
tes2.c:
Warning W8004 tes2.c 43: 'error' is assigned a value that is never used in funct
ion main
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'DAQmxCreateTask' referenced from C:\BORLAND\BCC55\BI
N\TES2.OBJ
Error: Unresolved external 'DAQmxCreateDOChan' referenced from C:\BORLAND\BCC55\
BIN\TES2.OBJ
Error: Unresolved external 'DAQmxStartTask' referenced from C:\BORLAND\BCC55\BIN
\TES2.OBJ
Error: Unresolved external 'DAQmxWriteDigitalU32' referenced from C:\BORLAND\BCC
55\BIN\TES2.OBJ
Error: Unresolved external 'DAQmxGetExtendedErrorInfo' referenced from C:\BORLAN
D\BCC55\BIN\TES2.OBJ
Error: Unresolved external 'DAQmxStopTask' referenced from C:\BORLAND\BCC55\BIN\
TES2.OBJ
Error: Unresolved external 'DAQmxClearTask' referenced from C:\BORLAND\BCC55\BIN
\TES2.OBJ
10-12-2008 01:33 PM
I need to provide a few more details. First, I am trying to compile the ANSI C Example program WriteDigPort.c. I have renamed the file tes2.c. Second, I am using NIDAQmx 8.x. Third, I am trying to program a NI-USB-6229. This is my first attempt to program an NI device.
10-13-2008 01:11 PM
Check out the following link, it explains how to make DAQmx calls from Borland C
http://digital.ni.com/public.nsf/allkb/B09727F89DA3A06C86256F430071D88E?OpenDocument
Chris
10-15-2008 11:41 AM
I tried using the library file given in the above link and I still get the same result - unresolved externals. Do I need to use any compiler options? What doe I need to include in the file header?
I have:
#include <stdio.h>
#include "NIDAQmx.h"
10-16-2008 04:04 PM
Have a look at the following KB, it specifies several compiler options that are needed in order to compile the c examples from Borland C
http://digital.ni.com/public.nsf/allkb/C1C5214A711A57A2862562BB00067373?OpenDocument
Chris
10-17-2008 12:11 PM
Hi meox,
I've never used Borland's C++ compiler, but I think that you also need to tell the linker to link nidaqmx.lib into your application. The "-L" option appends a directory to the linker search path, but on most compilers it doesn't make the linker automagically link against all of the libraries in that directory. Does Borland have a corresponding "-l" flag (lowercase ell)?
Brad