|
|
Home » Community » Newbie corner » Upp .dll
Upp .dll [message #26108] |
Thu, 01 April 2010 15:18 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I have several apps in C++.
Using Upp is very good and and easy, with help of course.
I would like to pull some functions out of a Java app and have them as a .dll. The Java app also uses jogl.dll.
Most of the technical issues on linking will be with the java app but what issues may I run into as far as a .dll made with Upp?
|
|
|
|
Re: Upp .dll [message #26111 is a reply to message #26109] |
Thu, 01 April 2010 17:17 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
That could be the biggest problem, C++ to Java.
The jogl.dll is also java code AFAIK, it is from Sun.
Using a socket in C++, Upp or Python works with a Java app but for several functions a more direct link would be preferred.
[Updated on: Thu, 01 April 2010 17:28] Report message to a moderator
|
|
|
|
Re: Upp .dll [message #26119 is a reply to message #26117] |
Fri, 02 April 2010 09:37 |
cbpporter
Messages: 1406 Registered: September 2007
|
Ultimate Contributor |
|
|
As always I have sources all over the place if I don't use version control, but I think I found some of my earlier attempts. Seems quite out of date realative to final attempts though.
File attached.
-
Attachment: MyApps.rar
(Size: 1.47KB, Downloaded 268 times)
[Updated on: Fri, 02 April 2010 09:39] Report message to a moderator
|
|
|
|
|
|
|
Re: Upp .dll [message #26139 is a reply to message #26138] |
Mon, 05 April 2010 15:45 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
"You must configure the include path from TheIDE on your command line." I will need to find out how that is done. For Eclipse and MSVC that was done in the IDE.
I tried several different ways for the double quotes, it still split between Program and Files.
"The Visual Studio 2005 Command Prompt automatically sets up the correct path to the Visual C++ compiler and any needed libraries, so it is used instead of the regular Command Prompt window."
http://msdn.microsoft.com/en-us/library/ms235639%28VS.80%29. aspx
This was important for the C++ includes, admin. privileges (even though UAC is off). Then they compiled OK with:
cl -I"c:\Program Files\Java\jdk1.7.0\include" -I"c:\Program Files\Java\jdk1.7.0\include\win32" -MD -LD HelloWorld.c -FeHelloWorld.dll
The files look good, have not been able to run it yet.
Apparently GCC/GCJ CNI and Swig depend on the JNI or similar.
It is just the interface from Java to Native code.
The necessary changes to the JNI files can be compiled on the command line.
It would be good to do it in theIDE.
Once this is set up a C++ .dll can be made with Upp.
The Java app code will be changed with Eclipse.
-
Attachment: Hello.zip
(Size: 5.97KB, Downloaded 245 times)
[Updated on: Mon, 05 April 2010 16:50] Report message to a moderator
|
|
|
Re: Upp .dll [message #26145 is a reply to message #26139] |
Tue, 06 April 2010 00:41 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Previously, after copying the Java directory, it compiled with:
cl -Ic:\Java\jdk1.7.0\include -Ic:\Java\jdk1.7.0\include\win32 -MD -LD HelloWorld.c -FeHelloWorld.dll
My PATH originally was: C:\Windows\system32;C:\Windows
I added the Java but that probably was not necessary as that worked before.
After running the MS SDK CMD Shell (which is SetEnv.cmd) this is the PATH, what a mess.
PATH=C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin;C:\Program Files\Micros
oft Visual Studio 9.0\VC\vcpackages;C:\Program Files\Microsoft Visual Studio 9.0
\Common7\IDE;C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin;C:\Windows\Microso
ft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framework\v2. 0.50727;C:\Program F
iles\Microsoft SDKs\Windows\v7.0\Setup;C:\Windows\system32;C:\Windows;C:\Wi ndows
\System32\Wbem;C:\Java\jdk1.7.0\bin;C:\Java\jdk1.7.0\include ;C:\Program Files\Mi
crosoft Visual Studio 9.0\VC\bin;C:\Program Files\Microsoft Visual Studio 9.0\Co
mmon7\IDE;C:\Program Files\Microsoft Visual Studio 9.0\VC\include
After removing any changes to the original and re doing the javac, javah and cl and trying java HelloWorld:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\MyApps\JNIex\HelloWorld.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1922)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1848)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1078)
at HelloWorld.<clinit>(HelloWorld.java:7)
line 7: printf("Hello World!\n");
then the C/C++ cl compiled .h/.dll
Attached is the code as in the original example.
-
Attachment: Hello.zip
(Size: 6.07KB, Downloaded 460 times)
[Updated on: Tue, 06 April 2010 02:24] Report message to a moderator
|
|
|
|
|
|
Re: Upp .dll [message #26155 is a reply to message #26108] |
Tue, 06 April 2010 10:48 |
mr_ped
Messages: 825 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
TheIDE -> project -> package organizer -> select the package which should be affected, right click into the large area on right, select "New internal includes..", enter directory's full path.
update:
It will affect compilation of all project's packages, no matter where you put that setting, but if the other packages are used in different projects, they will be compiled without it, so make sure you put that setting into every package which actually really needs that include path, it will carry it over to all projects where that package is used.
[Updated on: Tue, 06 April 2010 10:50] Report message to a moderator
|
|
|
|
|
Re: Upp .dll [message #26270 is a reply to message #26260] |
Tue, 20 April 2010 01:56 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
With the ability to set the paths in theIDE as mr_ped mentioned this should be much easier than adding to PATH.
|
|
|
Goto Forum:
Current Time: Fri Nov 01 01:19:17 CET 2024
Total time taken to generate the page: 0.02506 seconds
|
|
|