I am following example 1 in the labview documentation on calling external code from a dll. I am using labview 7.1 with the microsoft visual C++ compiler.
I want to compile this source code
/* Call Library source file */
_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 (i); *avg = sum / size return (0); }
into a dll file but get the following errors.
Does anyone have any suggestions.
Deleting intermediate files and output files for project 'myshared - Win32 Debug'. --------------------Configuration: myshared - Win32 Debug-------------------- Compiling... myshared.c c:\documents and settings\user\desktop\array average\myshared.c(10) : error C2065: 'NULL' : undeclared identifier c:\documents and settings\user\desktop\array average\myshared.c(10) : warning C4047: '!=' : 'float *' differs in levels of indirection from 'int ' c:\documents and settings\user\desktop\array average\myshared.c(18) : error C2143: syntax error : missing ';' before 'return' Error executing cl.exe.