LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Call library Function

Hi. I am using Labview 8.5 fnd Microsoft Visual C++ 6.0. I want to create call library function. I did all steps using the Labview help: ...., created dll project, added C sorce file and built. Then error happened: fatal error C1010: unexpected end of file while looking for precompiled header directive.
 
  Please, help me to solve this problem.
 
Yours sincerely, Dmitry
0 Kudos
Message 1 of 5
(2,940 Views)

Hi Dmitry,

This is a C++ build error - it means that you have told the compiler that you intend to use a precompiled header.  (By default, the precompiled header is "stdafx.h" in VC++.)  If you do not intend to use precompiled headers, then you need to disable that option for your source file in VC++.  If you search for precompiled headers, you should be able to find the info needed to do this.  It is a VC++ thing - nothing to do with LabVIEW.

Rob

0 Kudos
Message 2 of 5
(2,935 Views)
Thank you, I've solved this problem, but i have another one. I wrote the programm in MSVC6 for multiplication two numbers.
I created the dll and loaded it into call library function. Ran the vi, changed the input parameters but the value of output parameter did not change.
I send the Word file with 3 pictures made by printscreen button.
Please, help me.
0 Kudos
Message 3 of 5
(2,925 Views)

I'm not familiar with the extcode header and the int32_t data type, but I assume it is a simple typedef to a 32-bit integer.  In any case, you may as well use the same data type for the local variable "C" - I don't really think that is the problem, but it can't hurt.  What I don't understand is how the C++ DLL could possibly work - you haven't exported the mult function.  Maybe NI has provided some mechanism to call the code without the typical DLL hooks, but it is not a standard way of accomplishing language interoperability.  My suggestion, if noone else can help and you can't get to the bottom of this, is to allow VC++ to create a DLL with exported symbols.  (Create a Win32 project and there should be an option to create a DLL and to have it "export symbols" which basically means it creates some sample code to show you how to export your own functions.)

If anyone else has experience doing this without exporting symbols, please chime in.  Thanks.

Good luck,

Rob

0 Kudos
Message 4 of 5
(2,920 Views)

Hi Dimon87,

 

Please refer to the following article for this exact application:  Creating a CIN That Multiplies Two Numbers

0 Kudos
Message 5 of 5
(2,908 Views)