LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I compile my cvi project including a vc++ library

Hello

I'm doing a cvi project that needs an external library compiled with c++.  This library is the winpcap library.  I'm trying to make a program that can use an ethernet device.  When I compile the project, it seems that cvi doesn't understand the definitions and symbols that are in the .lib file.  I've read about it in the help and I have learnt that .lib files are cvi library files, not the c++ ones.

So, ¿how can I use a library compiled in c++ with cvi?  Or much better, how can I read from and write to an ethernet card to do my own ethernet packets?

Thank you
Carlos Arcediano del Amo
0 Kudos
Message 1 of 5
(3,623 Views)

Hello,

here you have information about how to integrate a Visual C++ DLL into CVI. Maybe, you have forgotten something. Really, the .lib file is a necessary file for CVI to integrate external code. This file can be even created by CVI. You have this information in the second link

http://zone.ni.com/devzone/conceptd.nsf/webmain/23b41e710ae65ed88625686900620da7#3

http://zone.ni.com/devzone/conceptd.nsf/webmain/1d0c73348d50de5486256faf00614757#7

Moreover, if you are getting some linking errors, it could be due to the following:

http://digital.ni.com/public.nsf/websearch/6A381D116E127FBE862566890072B3AE?OpenDocument

Finally, you also could have an alternative to winpcap. You might use winsock2 in order to open raw sockets.

I hope this helps.

crisR

Message 2 of 5
(3,603 Views)
Hello, crisR

I've read the links you sent me and they work, but... my VC compiler is not configured to be compatible with CVI (or vice versa), I get this error:

 2 Project link errors
     Undefined symbol '_EnviaPaqueteSingleton@16' referenced in "probando_dll.c".
     Undefined symbol '_AbreDispositivoSingleton@8' referenced in "probando_dll.c".

In the pages you sent me I have read this:

Note: If you receive a project link error when running the project in LabWindows/CVI, verify that all libraries are included in the project. If all libraries are included, verify that you are using the compatibility mode that corresponds to your third-party compiler.

Well, ¿how can I make my compiler compatibles one with each other?

Thanks
 
Carlos Arcediano del Amo
0 Kudos
Message 3 of 5
(3,599 Views)
Hello

I have solved the problem.  it is because I have defined the functions as extern C but I haven't put that directive when I have wrote the function in the .c archive.

Carlos Arcediano del Amo
0 Kudos
Message 4 of 5
(3,583 Views)
Ok. This is fine. Anyway, you can choose the compatibility mode in Options-Build Options menu.
Here, you can change between Visual C++ and Borland C++.
 
Congratulations.
 
crisR
0 Kudos
Message 5 of 5
(3,577 Views)