Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

linking niimaq.lib with GCC

I had diffiulties to link NIDAQmx with GCC compiler (Dev C++) or minGW.
I had found an anser by Joe Savage, implementing direct calls to nicaiu.dll. I works fine. See the last messages at this place.
http://forums.ni.com/ni/board/message?board.id=250&thread.id=10936&view=by_date_ascending&page=1

Now I need to do the same with my NI-IMAQ. niimaq.lib
It used to work with CVI, but I definitely switched to C++, and I enter in the same troubles of the same kind:

  [Linker error] undefined reference to `_imp__imgInterfaceOpen@8'  etc...

Can anybody tell me wich dlls are called by niimaq.lib, and the name of the symbols there for at least the most common tasks:

imgInterfaceOpen ("img0", &Iid);imgSessionOpen (Iid, &Sid);imgClose (Sid, TRUE);imgSessionStopAcquisition (Sid); imgSnap(Sid,(void**)&imgBuff); imgSetAttribute (Sid, ....); etc...

Thanks in advance

 
0 Kudos
Message 1 of 5
(4,429 Views)
Hi,
 
You can get the functions definition here : http://zone.ni.com/reference/en-XX/help/370161G-01/imaqfr/constants/ but there is no way to tell you which DLL call. You might have to find it by yourself.
 
Best regards,
0 Kudos
Message 2 of 5
(4,385 Views)

The anser does not help at all. I know where I can find documentation about NI-IMAQ functions.
<p>I have run the following code snippnet (I've done it with a lot of nii*.dll, but the most probable should be niimaqci.dll),
<br>A few DLL effectively load-in, but none contains the expected symbol "imgInterfaceOpen", nor "_imp__imgInterfaceOpen".

<p>Thus : I continue stuck with a niimaq.lib, that cannot be linked with GCC calls to basic NI-IMAQ finctions:
  [Linker error] undefined reference to `_imp__imgInterfaceOpen@8'
<br>And my attempts to directly load from dlls do not work.



<pre>
/* Load the DLL and get the addresses of the functions */
static int LoadDLLIfNeeded(void)
{
    if (DLLHandle)
        return 0;

    DLLHandle = LoadLibraryA("niimaqci.dll.dll");
    if (DLLHandle == NULL) {
        return kFailedToLoadDLLError;
        }

    if (!(dllimgInterfaceOpen_Ptr = (void*) GetProcAddress(DLLHandle, "imgInterfaceOpen")))
        goto FunctionNotFoundError;

 
    return 0;

FunctionNotFoundError:
    FreeLibrary(DLLHandle);
    DLLHandle = 0;
    return kCouldNotFindFunction;
}
</pre>

0 Kudos
Message 3 of 5
(4,264 Views)
I have also attempted to look the symbols in all my ni*.dll, which are not part of NI-DAQmx  (and there are a lot of them),

I have used pexports.exe tool, available at www.emmestech.com for that purpose.

I could not find any symbol like the ones I used with NI-IMAQ in CVI.

I am very sad today.


0 Kudos
Message 4 of 5
(4,260 Views)
regarding dll dependencies, you may have a look at the first question i asked in this thread, and the following answer which will not help you a lot (but will confirm your findings).
0 Kudos
Message 5 of 5
(4,235 Views)