10-14-2010 11:27 AM
I am setting out for my first time to use C code with LabVIEW. The "Call DLL" example produced some very helpful C code, which I include at the bottom of this message. Now, I need to know how to build it. I would like to use GCC because it is free, but I have no experience with building DLLs under GCC. Anyone out there have a makefile, a BAT script, or some other helpful example of how to build an appropriate DLL with GCC?
Thanks,
Ken
----------------------------
#include "extcode.h"
/* LabVIEW created typedef */
typedef struct {
int32 dimSizes[2];
double elt[1];
} TD1;
typedef TD1 **TD1Hdl;
_declspec(dllexport) void ARRAY2DHandle(TD1Hdl array);
_declspec(dllexport) void ARRAY2DHandle(TD1Hdl array)
{
int i, j;
/* dimSizes[0] is the number of rows */
int numrow = (*array)->dimSizes[0];
/* dimSizes[1] is the number of columns */
int numcol = (*array)->dimSizes[1];
for(i = 0; i < numrow; i++)
{
for(j = 0; j < numcol; j++)
{
(*array)->elt[(i * numcol) + j] = (*array)->elt[(i * numcol) + j] *
(*array)->elt[(i * numcol) + j];
}
}
}
10-14-2010 12:20 PM
I have no experience with gcc, but Microsoft makes available Express Editions of their development tools which are also free. So, you can get Visual Studio C++ Express for free.
10-15-2010 12:56 AM
Hi,
go to the eclipse homepage, http://www.eclipse.org/, get the IDE (it's free). Get the gcc compiler and register it in Eclipse. After that it's easy to build something, look in the help of Eclipse IDE.
cosmin
10-15-2010 02:10 PM
Hi Ken,
Take a look at this community post.