LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using static library developed in VC in CVI

I have a static library (.lib file) compiled in VC++ (just plain C no C++
stuff) which I need to us ein my CVI project. I can call 2 of the functions
with out any problems but other give me link errors. The person who
developed the library tells me that it works using the microsoft tools so
something wrong in my setup.

Is there any way I can find out what functions are defined in the .LIB file
and what are their signatures?

I have got an example program from this person which shows how to use the
library. My problem is that the header file included with the .lib file
doesn't list the function being called in the example program. The person
said that using following command works (I haven't tried it myself yet)

cl example.c stat
iclib.lib

When I call the same function in my CVI project, I get link errors.

I know getting more details from this person would help but they are not
that cooperative so I am stuck with what I have.

vishi
0 Kudos
Message 1 of 3
(2,912 Views)
Hi Vishi,

I suppose one way to get around is to create a dll (along the lib file), in VC++, and integrate everything in CVI.
Have a look here:
http://zone.ni.com/devzone/devzone.nsf/webcategories/3521E1AFBED61B5506256874000FD568?opendocument&node=dz52159_us

which tells about DLL Integration.
So, just ask this person to create also a dll (along the .lib file, the process I think is the same, so you get at the end both files), and supply it to you, together of course with the corresponding header file.

Then you can integrate all three in CVI. There are instrunctions here:
http://zone.ni.com/devzone/conceptd.nsf/webmain/23B41E710AE65ED88625686900620DA7?opendocument

hope that helps

COSTAS
0 Kudos
Message 2 of 3
(2,912 Views)
Hello,
Does the extension of the source code for the static library have .c extension, or does it have .cpp extension? If it has .cpp extension, then the libray was compiled in the C++ compiler, not the C compiler. If you have to use the .cpp exntesion for the source code, then please make sure to use extern "C" declarations.

Mika Fukuchi
Applications Engineer
National Instruments


If you are using .cpp file, then
0 Kudos
Message 3 of 3
(2,912 Views)