Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Edge Detection - 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.
0 Kudos
Message 1 of 4
(3,400 Views)
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
0 Kudos
Message 2 of 4
(3,400 Views)
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 3 of 4
(3,400 Views)
I had the same problem. Backup your nimachinevision.h file and use the attached instead. Then add nimachinevision.c file to your project if you have not already done so. Next go to project -> Settings -> C/C++ tab, and click on the Category drop down list box and select "Precompiled Headers", then select Not using precompiled headers. You will still get hundreds of warnings though, all from nimachinevision.c, but I don't what to do to fixe that. My problem right now is that I'm not able to access any of the elements of the imaqFindEdge StraightEdge report after the function returns the edge report. Please let me know if you know how to do this.
0 Kudos
Message 4 of 4
(3,400 Views)