LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

dll/libraries - Dev-C++

hello everybody,
i want to use the imaq vision functions to acquire images, doing a pattern matching an so on.
the point is: i want to use "Dev-C++" from Bloodshed. i tried the following sample from one of the
pages of ni:

********************************************************************
// This sample demonstrates how to acquire a picture using a high level snap operation
#include "stdafx.h"
#include <windows.h>
#include "snap.h"
#define _NIWIN
#include "niimaq.h"

int main(int argc, char* argv[])
{
   // Window Handle of the display window
   static HWND ImaqSmplHwnd;

   // Imaq globals
   static SESSION_ID Sid = 0;
   static INTERFACE_ID Iid = 0;
   static Int8* ImaqBuffer=NULL;

   // Create a window to display the image
   ImaqSmplHwnd = CreateIMAQWindow();

   // Open an interface and a session
   imgInterfaceOpen("img0", &Iid);
   imgSessionOpen(Iid, &Sid);

   // Snap a picture
   ImaqBuffer = NULL;
   imgSnap(Sid, (void **)&ImaqBuffer);

   // Display using NI-IMAQ
   imgPlot((GUIHNDL)ImaqSmplHwnd, (void *)ImaqBuffer, 0, 0, 640, 480, 0, 0, IMGPLOT_MONO_8);

   // Close the interface and the session
   imgClose(Sid, TRUE);
   imgClose(Iid, TRUE);

   return 0;
}
********************************************************************
i got a lot of linker errors, because of functions like "imgInterfaceOpen"
which dll/libs are required to use imaq vision functions in dev-c++?

thank you for your response,
best regards
malte
0 Kudos
Message 1 of 5
(4,113 Views)
Hi,
 
if you use a C++ Compiler you have the problem, that Labwindows/CVI use a C Compiler and therefore you have some errors.
 
you must create a .dll from your programm and insert it in the other application.
 
Or you form the C Code in C++ or C++ Code in C. But you should try the first way.
 
E.G. you create your application with Labwindows/CVI, test it, generate a *.dll and import it to Dev-C++ from Bloodshed ...
 
I hope i could help you
 
Best regards
 
 
0 Kudos
Message 2 of 5
(4,076 Views)
hi,
i switched the environment and i am using vc++ 6.0 now...the example given above could be compiled.
but there's still a problem with the Imaq-Vision functions...such as
c:\microsoftvisualstudio\myprojects\testitx\main.cpp(33) : error C2065: 'IMAQ_NO_RECT' : undeclared identifier

what can i do?

best regards,
malte
0 Kudos
Message 3 of 5
(4,053 Views)
ok, problem solved...but
now i tried to compile the EasyAcquireExample for Imaq Vision...after linking all .lib-files that can be found in the installation folder,
i get this linker errors:

Easy Acquire.obj : error LNK2001: unresolved external symbol _RunUserInterface@0
Easy Acquire.obj : error LNK2001: unresolved external symbol _DisplayPanel@4
Easy Acquire.obj : error LNK2001: unresolved external symbol _LoadPanel@12
Easy Acquire.obj : error LNK2001: unresolved external symbol _InitCVIRTEEx@12
Easy Acquire.obj : error LNK2001: unresolved external symbol _QuitUserInterface@4

which lib contains this functions?
malte
0 Kudos
Message 4 of 5
(4,052 Views)
Try adding cvirt.lib and cvisupp.lib from the folder ..\CVI\extlib\msvc

I hope this helps

Bilal Durrani
NI
0 Kudos
Message 5 of 5
(4,027 Views)