LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW embedded - no C++ code

Hi,
how can I tell LabVIEW embedded to generate the c-code without using C++ elements like // or extern "C"?
Thanks
Thomas
 
0 Kudos
Message 1 of 4
(2,887 Views)
 

Hi Thomas,

LabVIEW Embedded will convert VI's to C code automatically - it is not intended to generate C++.  (As a side note, the // comment style is part of the official C standard, but this occurred only recently in the 1999 revision)

Are you running into the case where LabVIEW Embedded is producing code that your toolchain cannot accept?  If so, what VI converts down to the invalid code, and what tools are you using beyond LabVIEW?  (i.e., gcc, VDSP++, etc)

For a list of all of the code generation options available to you in Embedded, we have a good resource in the Embedded Development Module Porting Guide (available at this link) that may be helpful to you.  All of the code generation options may be found in Chapter 4 of this guide.

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 4
(2,853 Views)
Matt,
you are right, my NEC compiler doesn't accept the code. For the // I found a compiler switch to accept it.
But I still get a syntax error in the MemCheck.h by the extern command:
 
#ifdef __cplusplus
extern "C" {
#endif
struct _ArgList;
extern VoidHand CGenMemHandleNew( unsigned long nSize, TextPtr strFilename, uInt16 nLineNo );
What I'm trying at the moment is to generate c-code based on an empty VI and to compile it manually with the NEC compiler.
And I'm reading the Embedded Development Module Porting Guide ;o)
 
Thanks,
Thomas
 
0 Kudos
Message 3 of 4
(2,836 Views)

Hi Thomas,

The MemCheck.h file is one of our pregenerated header files that we call from our generated code files, so I suspect that we're hitting another compiler/linker setting rather than a LabVIEW code generation issue.  If the syntax error occurs in the extern VoidHand line, there may be a compiler option within the NEC compiler that permits linking external code that we need to set.  Does the syntax error give any more information about why the line is illegal?

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 4 of 4
(2,812 Views)