How can I create a Code Interface Node (CIN) Project in Visual Studio 2005?Primary Software: LabVIEW Development Systems>>LabVIEW Full Development SystemPrimary Software Version: 7.1 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I am trying to use C/C++ code in LabView. How should I configure the project build settings in Visual Studio 2005 to be able to use them in Code Interface Nodes (CIN) in LabView? Solution: Currently there is a Creating a CIN Project in Visual Studio .NET 2003 tutorial that describes how to configure Visual Studio .NET 2003 to create a CIN project to write CIN code for use in LabVIEW 7.1. This tutorial however doesn't fully work for Visual Studio 2005. If you follow the steps outlined in that tutorial in Visual Studio 2005, you will initially get linker errors when trying to build. If you follow the instructions exactly, you will get a linker error the first time you try to build which says error LNK2001: unresolved external symbol _CINRun. This linker error occurs because of how C++ does name decorations. By default, the C++ compiler uses a technique called name mangling which incorporates the function name with its signature (list of arguments) in order to create a unique name. Thus, you need to force the compiler to avoid name mangling by using the extern “C” syntax after the library declarations as in the following code example: #include "C:\Program Files\National Instruments\LabVIEW 8.2\cintools\extcode.h" MgErr CINRun(int32 *Num1, int32 *Num2, int32 *Sum) C/C++ Project Settings Custom Built Step Settings Deploying CINs from Visual Studio 2005 When you distribute CINs to a machine without Visual Studio 2005 installed on it, you must make sure to install the needed C/C++ runtime libraries. To do this, you can simply install the Visual C++ 2005 Redistributable Package. This requirement is not specific to CINs but is required by any application that is built against those libraries.
Related Links:
Creating a CIN Project in Visual Studio .NET 2003 What Does the lvsbutil Utility in LabView do? Visual C++ 2005 Redistributable Package Attachments:
Report Date: 12/31/2007 Last Updated: 04/10/2008 Document ID: 4GU9I4P9 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
