ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C++ Cannot Open extcode.h

I am trying to follow the tutorial "Using External Code in LabVIEW," https://www.ni.com/docs/en-US/bundle/370109b/resource/370109b.pdf.  I am using Microsoft Visual Studio Community 2015, which is quite different than the IDE described in the tutorial.  Still, I hacked my way through the instructions until I get to the part where I try to build the dll.  At that point, I get an error message stating that the program "cannot open source file "extcode.h."  Does anyone have ideas as to why this might be happening?  At this point, my C++ code looks like this:

 

/* Call Library source file */

#include "extcode.h"

_declspec(dllexport) long avg_num(float a[], long size, float *avg);

_declspec(dllexport) long avg_num(float a[], long size, float *avg)
{

    int i;
float sum=0;
if(a != NULL)
    {
    for(i=0;i < size; i++)
        sum = sum + a[i];
    }
else
    return (1);
*avg = sum / size;
return (0);

}

 

Thanks.

Forbes Black
Lapsed CLAD, LV 5 - LV 2023 (Yeah, I'm that old...)
0 Kudos
Message 1 of 2
(5,319 Views)

1... You didn't specify which LabVIEW version you are using; I've no idea why not.

2... Your link is gorched.  try https://www.ni.com/docs/en-US/bundle/370109b/resource/370109b.pdf .

3... The doc you tried to link to is dated July 2000.

4... I believe that External Code has been deprecated as of LV 2012 / 2013 (not sure which), in favor of using only DLLs / shared libraries.

 

You should either:

 

--- Revert to an older version of LabVIEW

or

--- Build a DLL / shared library, using the manuals appropriate to your LV version.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 2
(5,300 Views)