Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Unresolved Link

I am trying to detect edges on an image.
Everything looks fine except the actual imaqFindEdge function.
-----------
StraightEdgeReport *report1, *report2, *report3, *report4;
RotatedRect rect1 = { 90, 81 ,80, 77, 0.00};
RotatedRect rect2 = {188, 79, 80, 80, 0.00};
RotatedRect rect3 = { 94, 250, 70, 80, 0.00};
RotatedRect rect4 = {138, 250, 70, 80, 0.00};
BestLine *line1, *line2, *line3, *line4;
PointFloat pointFloat12, pointFloat34;
Point point12, point34;

report1 = imaqFindEdge(m_LowerCameraProcessedImage, rect1, IMAQ_TOP_TO_BOTTOM, NULL, NULL);
--------------------

I was sure to include the
#include "nimachinevision.h"
statement

I am getting the following error when I try to execute it (It does compile with no errors)
----
----------
error LNK2001: unresolved external symbol "struct StraightEdgeReport_struct * __stdcall imaqFindEdge
----------------
I know I am probably missing something simple, but can not think of what it is.
Any help you can provide will be greatly appreciated."


-posted by oso on 10/17/2002

Brent R on 10/18/2002 answered:
"You will need to include the \Vision\Lib\MSVC\nivision.lib file in the project. Go to Project >> Settings... and select the Link tab. Add this file to the project.

Regards,

Brent R.
Applications Engineer
National Instruments"

------------------------------------------------------
Brent,
I have tried this, but no success. If I look through niVision.lib with a hex editor, I notice that "imaqFindEdge" is not there. Could you verify this for me. If so, what would you recommend next?
Enclosed is the code I am trying to compile. This is basically a blank dialog project with just a push button on the form.
0 Kudos
Message 1 of 4
(3,196 Views)
Sir,

Most likely you don't have the linking directories set correctly. Go to Tools>>options>>directories and add all the directories for the include files and lib files. This should get your program linking up.

Best Regards,

Michael Hallonan
0 Kudos
Message 2 of 4
(3,196 Views)
Thanks for the reply Michael.
I verified this and it looks like my project is set up properly.
I am still getting the linking error.
Compiles are fine, no errors.
Do you have any further suggestions?
Thanks again,
Chuck
0 Kudos
Message 3 of 4
(3,196 Views)
IMAQ Vision for LabWindows/CVI is a ANSI C library (.lib), but National Instruments Machine Vision is a separate, open-source product, so source for those functions aren't in the IMAQ Vision library. You can build machine vision into a library if you wish and use that in your projects, or can just add file source/machinevision.c to your project and build it along with your other source files. This should resolve the linker error you're getting.

-- Chris
0 Kudos
Message 4 of 4
(3,196 Views)