Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Which external library links in <GetDoubleInf()> function?

I am getting a linker error under Visual Studio .NET (C++ 7.1). Is this a non-exported CVI function?

error LNK2001: unresolved external symbol __GetDoubleInf

I am currently linking in the following libraries:
cvirt.lib
cvisupp.lib

I could not link in because of errors like:

Linking...
LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj)
LIBCD.lib(dbgheap.obj) : error LNK2005: __nh_malloc already defined in LIBC.lib(malloc.obj)
LIBCD.lib(dbgheap.obj) : error LNK2005: __heap_alloc already defined in LIBC.lib(malloc.obj)

What can I replace under BuildPANEL() output that utilizes that function?
- tools(menu) :: UI-to-Code-Converter
0 Kudos
Message 1 of 4
(4,104 Views)
Hi,

This error has to do with the ANSI C libraries. CVI uses macros for some of the functions and VC++ does not uses them. So you get this linker errors on some of the ANSI C function calls.

There is a document that explains more about this and has a workaround. Please take a look at it and let me know if you have any further questions.

Unresolved External Symbol Link Errors When Using *.OBJ From CVI In MSVC

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 4
(4,104 Views)
The link above gave this solution:

"It is possible to link an obj in CVI so that it can be used in an external compiler. See the LabWindows/CVI Programmers Reference Manual for more information on this external compiler support."

Could you be more specific as to where in the "Programmer's Reference Manual" that this is explained. Is this in the HELP files too?

The link to a PDF version of the manual (page 3-10, 40-of-94) indicate. I did this, and I showed the error I was getting.
"Include cvi\extlib\arefsym.c in your external compiler project if your run-time
modules refer to any symbols in the ANSI C library."

(page 3-22, 52-of-94, under "Creating Object Files in LabWindows/CVI") does not explain how to export the functions defined
in the link.
0 Kudos
Message 3 of 4
(4,104 Views)
Hi,

cvi\extlib\arefsym.c is required only if you are loading CVI modules dynamically using LoadExternalModule(,,,). In this case, you are just compiling CVi functions in .NET.

Let me give you a quick overview on this to clear this a bit. For the CVI functions (LoadPanel, SetCtrlAttribute, etc.) there is no problem; they are defined in userint.h, formatio.h, tcpsupp.h, etc. and you link to them by using cvirt.lib and cvisupp.lib.

ANSI C libraries are a bit more complicated since .NET and CVI have .h and lib files for those functions. Each compiler has implemented those functions. You must make sure that you are using the right .h files with the right /lib files. It's generaly recommended that you use the .NET ANSI C functions. For this
you must make sure that you are using the ANSI C .h files from .NET. Tha is do not use the .h files located at C:\Program Files\National Instruments\CVI70\include\ansi use the ones that .NET provides.

you can see how different this h files are from one compiler to the other. that is why .NET is not able to compile CVI's ANSI C files.

Please give this a try and let me know if you have an further questions on this.

Regards,

Juan Carlos
0 Kudos
Message 4 of 4
(4,104 Views)