LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build a library project in borland C++ builder

Hi!
I read the manual "Using External Code in LabView". And in Chapter 3, Task 3 is a description, how to build a dll with Microsoft Visual C++ 6.0! That description is great. But the problem is: I DON'T HAVE THIS PROGRAM!

Does anybody knows a description how to create a shared library with borland C++ Builder 5.0/6.0?
Well, I can create a dll, but LabView tells me it would be no valid windows file.

I also have an idea what the problem is:
I have to link the project in borland to an executeable. I choosed LabView.exe. Is that the Problem?
0 Kudos
Message 1 of 4
(3,940 Views)
Slartibartfast;

Why are you saying LabVIEW will tell you is not a valid Windows file? Are you actually receiving that error?

You can create a dll in C++ Builder and call it from LabVIEW. I think you need to do the following: In C++ Builder, go to Project->Options. In the Dialog Box, select the tab for Advanced Compiler, change the Data Alignment to Byte and the Calling convention to Standard call.

Also, I don't know why you said that you need to link the project to an executable. You don't need to do that. When you create the .dll, Builder may reply with an odd error saying that it can't debug... just ignore the error and make sure the .dll was created.

Let us know if that was of help.

Regards;
Enrique Vargas
www.visecurity.c
om
www.vartortech.com
0 Kudos
Message 2 of 4
(3,940 Views)
I tried it again!
I created the .c file in LabView. I created a new dll - project in borland c++ and added the .c file to the project. Then I changed the options of the Project. I only changed Data Alignment to Byte. The Calling Convention I left at C, because the Library Funcion Node expects it. (I also tried with Standard! No Effect!)

I built the dll and received no errors. But when I went back to LabView and Opend the FilePath in the Library Function Node, I received the Error "Image Incorrect - The Application or DLL is not a valid windows file. Check this with your install disk!"

I assume the problem in the project options in the CBuilder. In Visual C you have to change the Option "Use run-time library". I don't know what
is the equivalent option at CBuilder.

The Problem with the link to an executeable is solved. You are right, I don't have to link the file.
0 Kudos
Message 3 of 4
(3,940 Views)
OK, the Problem is solved!
The Problem was an incorrect installation of the C++Builder.
After I have reinstalled it I created a new dll and it worked!
Thanks for your help!
0 Kudos
Message 4 of 4
(3,940 Views)