LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cannot find malloc.h and ansi_c.h

Hi,
I am developing a parser in labwindows environment. My parser needs malloc.h and ansi_c.h, which are not referenced in /include directory of mesurement studio directory. Please can anyone tell me, is there any alternate files coded for malloc.h and ansi_c.h or should i refer to different directory
 
Thank u,
Raghavendra
0 Kudos
Message 1 of 6
(8,140 Views)
Howdy Raghavendra,
 
You didn't mention what version of LabWindows/CVI you were using but since you mentioned Measurement Studio, I am assuming LabWindows/CVI 6.0.  LabWindows/CVI is an ANSI C compiler which means that it comes with the standard C library that includes standard C header files. The malloc.h header file is not one of those standard header files. The malloc.h header file is associated with the Microsoft C Run-Time Libraries (CRT).  You can find copies of this header file in the Microsoft Visual C++ directories if you have those IDE's installed. For example, you will find this header file in locations such as <Program Files>\Microsoft Visual Studio 8\VC\include, <Program Files>\Microsoft Visual Studio\VC98\Include, <Program Files>\Microsoft Visual Studio .NET 2003\Vc7\include.  Find out more about the C standard libraries here.
 
As far as the ansi_c.h header file, it should be located in the <CVI>\include\ directory.  This directory is valid for CVI 6.0, 7.x, and 8.x.  By default, this include directory is searched by LabWindows/CVI as one of its include search paths.  See if you can run any of our examples that use that header file. 
 
Hope this helps!
 
Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 6
(8,124 Views)

What do you need from malloc.h?

The CVI ANSI C library includes the following memory management functions in stdlib.h: calloc, free, malloc, and realloc.

0 Kudos
Message 3 of 6
(8,095 Views)

Hi,

I have a CVI dll (let's call it MyCVIdll) and I'm trying to use in it some functions from another dll created in Visual C++ (let's call this dll "VCdll"). I included VCdll.h in my MyCVIdll project as well as VCdll.lib. Since VCdll uses GTK and its associated glib.h, when I try to compile, CVI asks for a couple of GTK header files and I added the corresponding folders in the CVI Include Paths.

Everything goes fine and then one of this GTK headers (galloca.h) asks for malloc.h so I included also "C:\Program Files\Microsoft Visual Studio 8\VC\include" to the CVI include paths since malloc.h is there. But then I got several syntax errors in crtdefs.h (which looks like it's needed by malloc.h and is also in Visual Studio 8\VC\include).

I manually set #define _MSC_VER 1400 in MyCVIdll.h.

Does somebody know why this is happening? Should I manually add another #define somewhere? Actually this can be easily replicated in any CVI dll project, just add "C:\Program Files\Microsoft Visual Studio 8\VC\include" to the CVI include path (options->environment->include paths), try to compile the project and you'll get several syntax errors in crtdefs.h. How to avoid those errors?

Environment: LabWindows CVI 8.1 and MS Visual Studio 2005

Thanks a lot for your help,

Delfino

 

0 Kudos
Message 4 of 6
(7,888 Views)
you'll have better luck getting an answer if you create a new thread for your new topic, rather than tag onto an old, out-of-date thread.

--rj



0 Kudos
Message 5 of 6
(7,879 Views)
Hello,
Please look your answer here :
Regards.
Manuel R
AE dans une autre vie
0 Kudos
Message 6 of 6
(7,803 Views)