Joe Savage's NIDAQmx.c approach, which is basically to construct an "import library" in C, seems a bit overkill.
I used MS's dumpbin /exports on the NI import library (.lib, NOT the .dll) to generate a listing of the exported symbols, which I hand-edited into a .def file. Then I used dlltool to create an import library, libnidaqmx.dll.a.
The link step is then just: gcc -mno-cygwin example.o -lnidaqmx -o example.exe
Dear experts, I would like to make a wrapper DLL so that I can make calls from Borlands Delphi.
Stadel wrotes: >I also found a similar topic dealing with Borland C in the knowledge base: >"How Can I Use The NI-DAQmx ANSI C Function Library With Borland C and Delphi?" >http://digital.ni.com/public.nsf/websearch/B09727F89DA3A06C86256F430071D88E?OpenDocument >where an NIDAQmx.lib file for Borland C is available.
But where is the Borland C file. I could not find it. Moreover has anyone created such a wrapper DLL and how are the calles are made? I also looking for examples how to write and read digital IO of the USB-6501. I have programmed an application for the DIO24 PCMCIA card with the traditional NI-DAQ driver (and with its ActiveX Components) and works fine. But now I would like to change to the USB-6501 DIO card but have no idea how I could make it from Delphi 7.
I would be very helpfull for any advices and information. Please send a copy to email@example.com of your postings. Tks
I have been wrecking my head with this or the lasty two days. I have executed all your instructions to the letter and everything has worked well. Unfortunately, when I try to execute the resulting .exe I get the following pop up message:
"This application has failed to start because WINDOWSsystem32 icaiu.dll was not found. Re-installing the application may fix this problem"
What's uncanny is that it says icaiu and not nicaiu.....christ only knows why! To think that it has taken two days to run a simple C program which is meant to be ANSI C compatible and all because NI don't feel its worth supporting the worlds most popular C compiler.....seriously!
I have used the method, which has developed here, since nearly a year, but I have not yet encountered your problem. So I can only make guesses. I use cygwin and have run cygcheck on one of my executables. The part of the output below shows the the relevant dlls, which are used:
There is no icaiu.dll at all, but the root dll is called nicaiu.dll!
My guess is that there is some problem with backslashes. You have quoted the path of the dll as WINDOWSsystem32 icaiu.dll And all backslashes are missing. Perhaps it actually was \nicaiu.dll, and the '\n' was interpreted special?
Are you really sure, that C:\WINDOWS\system32\ is in your PATH? In my case the (cygwin) $PATH is set to something like: > echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/system32 where /cygdrive/c/WINDOWS/system32 actually points to C:\WINDOWS\system32 under cygwin.
You could copy C:\WINDOWS\system32\nicaiu.dll into the directory of your executable just to check whether the error message changes (of course, several other dlls would still be missing).
I hope this is a starting point to figure out the problem.
I removed the -D argument and now everything works well.....err...nearly. I can compile and run from windows cmd but i'm havng problems linking the "libnidaqmx.a" to a simple test compile using Eclipse 3.1.2, CDT 3.0.2, MinGW and MSYS. Everything compiles well in this dev env but I keep getting the following error at the linking stage:
Invoking: GCC C Linker gcc -oManagedTest.exe ./src/AngularPosition-Buff-Cont.o -lD:\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\libnidaqmx.a d:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lD:\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\libnidaqmx.a collect2: ld returned 1 exit status
I know this is beyone the call of duty....but any ideas ?