LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using gcc with Call Library Function

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];
    }
  }
}

0 Kudos
Message 1 of 4
(2,754 Views)

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.

0 Kudos
Message 2 of 4
(2,745 Views)

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

0 Kudos
Message 3 of 4
(2,729 Views)

Hi Ken,

 

Take a look at this community post

 

 

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 4 of 4
(2,707 Views)