Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined external error messages compiling in Borland C++

I'm using:

Win95 machine
Ni-daq 6.9.1
NI PCI-6025e DAQ card
Borland C++ Builder 5.0.12.34

When I try to compile my C project I get the following error:

[Linker Error] Unresolved external 'DIG_Out_Prt' referenced from
C:\SCOTT\DLL_CODE\ELLIPSE_TEST1\WRITETOPB.OBJ

Here is the code I'm attempting to build:

#include
#include
#include
#include "c:\Program Files\National Instruments\Ni-daq\Include\nidaq.h"

__declspec(dllexport) long portWrite(void);

long portWrite(void){
long value;
long status;

value=(0x0001);
status=
DIG_Out_Prt(1,2,value);

return status;
}

It is some very simple code just to test that I can get these ni-daq functions to work in
a dll that I can then access from LabVIEW.

I found a knowledgebase article at the following location which seems to address my problem (but either I can't follow it or it just does not solve the problem):

http://digital.ni.com/public.nsf/ 3efedde4322fef19862567740067f3cc/ c1c5214a711a57
a2862562bb00067373?OpenDocument

Another thing that I found strange is that in nidaq.h the function is not DIG_Out_Prt
(as stated in the user manual, and the installed example) but rather DIG_Out_Port. I don't understand the discrepancy.

Any insight or help with these matters would be greatly appreciated.

Thanks,

Scott Allen
0 Kudos
Message 1 of 4
(4,602 Views)
If you search http://www.ni.com/ for "+daq +borland +c++" you should have several related documents pertaining to building DAQ applications in the C++ environment. There is one in particular (document ID 0HMI568Z) that addresses some incompatibilities with building the NIDAQ.h file (standar C prototypes) from a C++ compiler.
0 Kudos
Message 2 of 4
(4,602 Views)
The document (0HMI568Z) you suggest is the one that I "specifically" stated in my question as the article which did not help my situation. Please read the post in its entirety before offering any suggestions. As this post has now been answered it is unlikely that anyone else who may know what's going on will take the time to look at it. This is unfortunate as I really need to figure out the solution to this problem.
0 Kudos
Message 3 of 4
(4,602 Views)
Have you include the .lib file for the nidaq ddl (maybe nidaq32.dll) ?
I think you have to create the lib with C++Builder tools (see help for
IMPLIB.EXE).
0 Kudos
Message 4 of 4
(4,602 Views)