Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I get unresolved externals when using Borland Command Line C compiler

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

0 Kudos
Message 1 of 6
(4,383 Views)

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.

 

0 Kudos
Message 2 of 6
(4,376 Views)

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

0 Kudos
Message 3 of 6
(4,346 Views)

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"

0 Kudos
Message 4 of 6
(4,327 Views)

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

0 Kudos
Message 5 of 6
(4,305 Views)

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

---
Brad Keryan
NI R&D
0 Kudos
Message 6 of 6
(4,289 Views)