Building DLLs
I'm learning JNI and I try to use the sun's tutorial at: http://java.sun.com/docs/books/tutorial/native1.1/index.html
I can do everything with Java, but I can't compile the .c, my compiler (dev-c++) reports an error message in the first line: #include "jni.h".
And this tutorial just shows how build a dll with MS Visual C++, I need to do this with Dev-C++, does anyone knows how?
Thanks.
This is the full error report. This message still appear, but I can generate the ".o" object file and build the DLL with him. Now the problem is the Java program, they report tis message:
"java.lang.UnsatisfiedLinkError: displayHelloWorld
at jni.HelloWorld.displayHelloWorld(Native Method)
at jni.HelloWorld.main(HelloWorld.java:19)
Exception in thread "main" ".
I read in another message some solutions like put the library path in the path enviroment, or put the code extern "C" in the C program. Doesn't work!!!
I need to make a program in C to read systems info like disk capacity and free space, but I can't even make a Hello World Example, it's hilarious :)))
I'll appreciate any solution!
Thanks
[]s
Gabriel.
Similar Messages
-
Build dll error in application builder 8.6.1
Hello,
I get always an error in the LV 8.6 application builder, when I build a dll. There is only one function in it, that has a string and an error input, and nothing else. I attach a screenshot of the VI prototype, and hier is the error description:
Error 1 occurred at Building DLL.
A component needed for Application Builder does not support the required functionality. This might have been caused by installing an older version of LabVIEW after this version was installed. Reinstall the current LabVIEW version to correct this issue.
Possible reason(s):
LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge.
After that I reinstalled LV8.6, I tried to reinstall only the 8.6 app builder, but no success.Hello,
thank you for the reply.
I have solved the problem. I uninstalled the last installed LV version, this was 8.0. Then ran appbuilder again in 8.6, then I have got an instruction to run applibs\lvdllbuilder\lvdb.exe. Since then works.
regards
Mitulatbati -
Error Building DLL, LabView 8.2
Hello everybody,
I'm building a
CVI application. I need some functions of LabView (related to time
series analysis), so I'm trying to build DLLs with the .VIs I need. I
followed all the steps necesary and visited all the related topics at
ni.com. I always get the following error:
Visit the Request Support page at ni.com/ask to learn more about resolving this problem. +¡
Use the following information as a reference:
Error -2147221480 occurred at Building DLL stub.
This can be caused by illegal function or parameter
names. Please verify your names are legal C identifiers and do not
conflict with LabVIEW headers
This error code is undefined. No one has provided a
description for this code, or you might have wired a number that is not
an error code to the error code input.
Once, I got a correct DLL with no errors, so it should be possible for others.
This is an example of what I'm trying to compile:
And this is what appears, only for a moment, at the end of the
compiling (it didn't appear when I manage to build with no errors):
I'm using: LabView 8.2, LabWindows CVI 8.5, NI-DAQ 8.5, Windows XP (SP2)
Any suggestion is really appreciated.
Maybe another way to use this functions in CVI (I need functions related to spectral estimation, ARMA; MUSIC,...)
thank you!
Eduardo Tamargo
SpainHi Tamargo,
The following KnowledgeBases may help you find out what is happening:
Creating and Calling LabVIEW DLLs with Various Data Types from Microsoft Visual C++
What are the Differences Between "Array Data Pointer", "Array Handle", and "Array Handle Pointer"?
Calling a LabVIEW DLL from C with an Array in a Cluster as a Parameter
Have you tried developing a very simple VI with an array as an input parameter and checking if the same problem takes place when you build the DLL?
Regards,
David Oña -
I tried to run the example HelloWorld given in JNI tutorial. http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html
But when I try to build dll
I typed under dos
C:\Program Files\Microsoft Visual Studio\VC98\Bin>cl -Ic:\jdk1.3.1\include -Ic:\jdk1.3.1\include\win32 -LD HelloWorldImp.c -Fehello.dll
There was this error message:
/dll
/implib:hello.lib
/out:hello.dll
HelloWorldImp.obj
LINK: fatal error LNK1104: cannot open file "LIBCMT.lib"
Does anyone know what is wrong? Thank you very much for your help.That looks like one of your libraries from Microsoft visual studios is missing or the folder it belongs in is not on your path. do a search on your computer to see if the file exists...if it does, make sure your path has that folder in it.
if the file is there, and on your path...try getting a fresh copy from your visual studios install cd. if you cant find the file on your hard drive, you can either add the file to the visual studio folder or try reinstalling visual.
good luck -
Building DLLs from VIs with array as output
Is there any special way to build DLLs from VIs having arrays as outputs. Suppose I have a VI "Random" with input "nrand" and output an array "the_random2". When I build DLL from the VI, I have something like this in my header file
void __stdcall Random(long nrand, double the_random2[]);
Now it returns void. So I have to pass the array as pointer and retrieve it. If I use Mathscript to load the DLL and call this function, how do I pass the pointer to the array "the_random2"? Simply speaking, any useful method to build DLLs with array outputs and the right way to call them from Mathscript would be appreciated.
Regards
NRKHi,
Building DLLs in LabVIEW is described in this tutorial.
Mathscript can call shared libraries such as DLLs, however make sure
that they are compliant with the supported data types as stated here in
this help page. All supported functions for calling/loading shared libraries is described here.
Note that these functions are not supported with the base package. The
details of the sytax of each function is described in their specific
help page.
Hope this helps!
Regards,
Nadim
Applications Engineering
National Instruments -
Building DLLs with Returntype as string
Is it possible to pass strings to a function and get a return type as a string.
Actually iam facing a issue ,
I have built a VI with Input and output as strings,the VI is working correctly
when the dll for that VI,
Function prototype is always void and output is always passed as a reference parameter to the function.
Attachments:
Output return option..JPG 164 KB
Return value option.JPG 157 KBHi,
Building DLLs in LabVIEW is described in this tutorial.
Mathscript can call shared libraries such as DLLs, however make sure
that they are compliant with the supported data types as stated here in
this help page. All supported functions for calling/loading shared libraries is described here.
Note that these functions are not supported with the base package. The
details of the sytax of each function is described in their specific
help page.
Hope this helps!
Regards,
Nadim
Applications Engineering
National Instruments -
Building Dll for labVIEW RT gives errors
Hi All
Does building dll for labVIEW RT using CVI require labview runtime engine to be installed?
becuase i get some errors of unsatisfied referances to some library while building the dll with target selceted to "labVIEW real time only".
Regards
ArunHello Arun,
You don't need to have LabVIEW Run Time installed on your machine. Please check the link below to see the function that are supported by exporting the LabWindows/CVI LabVIEW RT Engine
http://digital.ni.com/public.nsf/websearch/D3EFE7C6F073384886256FDD005FBCDA?OpenDocument
Ame G.
National Instruments -
Error -2147221480 occurred at Building DLL stub
When I build a Shared Library, I get following error message
Error -2147221480 occurred at Building DLL stub.
This can be caused by illegal function or parameter names. Please verify your names are legal C identifiers and do not conflict with LabVIEW headers
This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input.
Can anyone help me out regarding this error...To begin with, do didn't say whether you have checked the two possible errors listed in the error message:
1) the function and parameter names are legal C identifiers
2) the function and parameter names do not conflict with LabVIEW headers
How many functions does your DLL have? What are their names?
What parameters do the function(s) have? What are their names?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Hi all,
do you know, can i build with LV Builder dll that will run with Front Panel open when i call it from some another VI?
I tried build it, but not succesfully.
The prolem was that if i select in VI properties "Show FP when loaded", dll runs with FP open, but property "Show FP when called" doesn't give same results. Dll runs, but in background.Nadav,
Did you see this recent post about LabVIEW calling LabVIEW DLLs? -
User events from labview build dll
Reference to pattern
Previous discussion
I had this pattern in place in a LV 7.1 application using a LabVIEW
build DLL, but when migrating to LV 8.5 I found that User Events
created in one application instance can not be fired by another
application instance. It seems that since LV 8.x a LabVIEW build DLL
are a different application instance. The generate user event function generates an error inside the DLL stating that it is not working because it is a reference from another application instance.
Is the behaviour of a LV build DLL different than a C build DLL? Is the C build DLL part of the same application instance as the LV executable?
Is there a way the get the LV build DLL to be a part of the same application instance as the LV build executable or development environment?
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)Forgot to tell that I rebuild the DLL in LV 8.5, before making that conclusion.
Message Edited by andre.buurman@carya on 09-04-2008 01:12 PM
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl) -
Microsoft.sqlserver.integrationservices.build.dll
Hi,
I am using MS build, but I am not able find the "microsoft.sqlserver.integrationservices.build.dll" I have looked in all the location. Can anyone let me know where I can get this DLL.
Thanks..
Regards Vikas PathakAs Koen wrote, this DLL isn't shipped with SQL Server, it's a community Project on CodePlex:
http://sqlsrvintegrationsrv.codeplex.com/SourceControl/latest#main/SSISMSBuild/Project/Microsoft.SqlServer.IntegrationServices.Build.csproj
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Applicatio​n Builder: error in building DLL from a VI
I have a VI which I have been compiling into a DLL for use with Labwindows. Suddenly yesterday the build would no longer compile. Instead the error message (see attached picture) persisted all day no matter what I changed in the VI. Before the error message appeared, the Labview project window went blank for a moment, then showed some "C" code from somewhere, and then back to the project window. It's almost like something blew up in the compile process.
I've tried all suggestions in the error message. Checked data types and names. I believed the VI is wired back to where it was. There is not much to the VI but it does reference some .NET assemblies.
Thanks for any comment or help,
Doug Wendelboe
Attachments:
VI-DLL-Pictures.zip 21 KBHi Eriquito:
Thanks for your response. I've included some snapshots of appropriate Ap Builder setup pages. My DLL is named "CVIMESQueryTray.dll". I had this compiling quite well up until a few days ago, so Ap Bldr didn't object then.
See if you can spot something in my ApBuilder setup that I might be doing wrong.
Thanks for your help.
Doug Wendelboe
(Hmmm.. I guess I can't attach more than three items, so I ZIPped them into one file).
Attachments:
ApBuilderPics.zip 154 KB
ProjectFile.JPG 60 KB
ApBuilderPage1.JPG 31 KB -
Hello,
I'm going to build an app.exe for my customer. When I sent it to him he claimes several missing dll's. On my machine I have everything and nothing is missing.
Is there a simple way to find out which dll's (and perhaps other things) are necessary for the distribution?
Thanks in advance
KlausYour dlls should be in the project and listed as dependencies. When you build the installer, they should get included. You did build an installer didn't you? You should also include any hardware drivers (DAQmx, NI-GPIB) that your program uses.
-
Error when building DLL using Keithley library
I'm trying to build a Labview Shared DLL of my VI's, however I'm using Keithley's KPCI-PIO24 Labview driver. When I include any of their library calls into my DLL, I will get a "LABVIEW.LIB was not called from a Labview process". I have mass compiled all the Keithley libs but this hasn't helped. Any ideas??
Bob WirthI am not 100% sure but I beleive that the KPCI line of drivers are DOS based. I know that Keithley's GPIB driver is DOS based. I am not sure about the labview drivers. This may have some effect on building a DLL. You may have to settle for building a llb instead of a DLL.
- tbob
Inventor of the WORM Global -
I am getting the following error when I try to build the dll in VC++.
"Linking...
Creating library Debug/winport.lib and object Debug/winport.exp
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs;
use /NODEFAULTLIB:library
MSVCRTD.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/winport.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe."
Can anyone help me to get rid of this problem?
Thanx & Regards,
Srini.srini,
Are you trying to use the dll in LabVIEW and getting the error from LabVIEW? If you are using Measurement Studio there is a seperate discussion forum for those issues. The MSVCRT is a Microsoft Visual C Run Time library. This thread explains it a little better: MSVCRT.dll
If you are trying to create C++ dlls to be used in LabVIEW you may need to create wrappers if you are using certain classes. Here is some more information on calling dlls in LabVIEW An Overview of Accessing DLLs or Shared Libraries from LabVIEW
Sam R.
Applications Engineer
National Instruments
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~
Maybe you are looking for
-
Safari v6.1 crashes everytime I open it
Hi, my Safari v6.1 (7537.71) keeps closing unexpectedly every 5-30 seconds of me opening it. I've tried the method of clearing webpageicon file but it still hasn't work. Does anyone have any suggestions or advice as to how to fix this? I do not have
-
How do I get Firefox Sync to work?
I have followed the Firefox Sync instructions a number of times. I want to copy the data from my old laptop onto my new. The new laptop just sits there and does nothing when I enter the generated code into my old laptop. When looking around for help,
-
I haven't been able to print a shipping label since yesterday morning, what's going on? I've always had issues with this but never so long. Called customer support, no help. Cleared cache, different browser,... nothing works.
-
Transfer Quantity from Project to another
Hello Dears, My Scanairo is : allocate the quantities on the project in the inventory by Move order , if i used some quantities and want to transfer the other to another project or return to the inventory. how can i do this? thanks
-
I am in the process of designing a new system and wonder if the following is possible. I want a UNIX script to execute a Jar file with a status of 1 or 0 (based of success/failure) being passed back from the Jar to the UNIX script. I know a Jar file