You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Arne Styve <as...@offsimcentre.no> on 2007/06/13 11:51:35 UTC

Anyone used the NAR plugin for native code ?

Hi,
 
I'm currently looking into the NAR plugin from the FreeHEP site
(http://java.freehep.org/freehep-nar-plugin/), and have some questions
regarding the use of this plugin.
I'm building a JNI-library from a Java class, on a x86-Windows platform.
 
Currently I have two issues:
 
1. When I use Microsoft C++ compiler and linker (msvc), I can build my
project from the Visual Studio 2005 commandline window, but not from any
command window, neither from within the Netbeans (v5.5.1) IDE I'm using.
Any ideas why ?
 
2. When I use the g++ compiler, the NAR-plugin doesn't seem to find the
C++ source file to compile. I get "0 total files to be compiled":
 
[INFO] [freehep-nar:nar-javah]
[INFO] Running javah compiler on 1 classes...
[INFO] [freehep-nar:nar-compile]
[INFO] Project base dir set to: C:\Documents and
Settings\asty\Skrivebord\linemodel
[INFO] 0 total files to be compiled.
[INFO] Starting link (3.4.4 -shared -lstdc++ -shared-libgcc)
[INFO] gcc -shared -o liblinemodel-1.0-SNAPSHOT.so -lstdc++
-shared-libgcc
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
 
 
Finally, my C++ implementation of the JNI library is dependent on a
third party DLL (or LIB) not found in any repository. Where in the
directorystructure should I place this DLL (or LIB) for the C++ linker
to find it and include it ?
 
Regards
Arne

Re: Anyone used the NAR plugin for native code ?

Posted by Mark Donszelmann <Ma...@slac.stanford.edu>.
Hi Arne,

On Jun 13, 2007, at 2:51 AM, Arne Styve wrote:

> Hi,
>
> I'm currently looking into the NAR plugin from the FreeHEP site
> (http://java.freehep.org/freehep-nar-plugin/), and have some questions
> regarding the use of this plugin.
> I'm building a JNI-library from a Java class, on a x86-Windows  
> platform.
>
> Currently I have two issues:
>
> 1. When I use Microsoft C++ compiler and linker (msvc), I can build my
> project from the Visual Studio 2005 commandline window, but not  
> from any
> command window, neither from within the Netbeans (v5.5.1) IDE I'm  
> using.
> Any ideas why ?
>

The command window is the IDE or something else.

I guess neither Visual Studio nor Netbeans knows how to integrate the  
nar lifecycle
needed to compile native components.

> 2. When I use the g++ compiler, the NAR-plugin doesn't seem to find  
> the
> C++ source file to compile. I get "0 total files to be compiled":
>
> [INFO] [freehep-nar:nar-javah]
> [INFO] Running javah compiler on 1 classes...
> [INFO] [freehep-nar:nar-compile]
> [INFO] Project base dir set to: C:\Documents and
> Settings\asty\Skrivebord\linemodel
> [INFO] 0 total files to be compiled.
> [INFO] Starting link (3.4.4 -shared -lstdc++ -shared-libgcc)
> [INFO] gcc -shared -o liblinemodel-1.0-SNAPSHOT.so -lstdc++
> -shared-libgcc
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]

Files are searched in src/main, but maybe you have them with some  
strange extension?

>
>
> Finally, my C++ implementation of the JNI library is dependent on a
> third party DLL (or LIB) not found in any repository. Where in the
> directorystructure should I place this DLL (or LIB) for the C++ linker
> to find it and include it ?

You need to (hand)-wrap it into a nar file and put it in your  
repository.
I have been thinking on how to automate this. A lot of people seem to  
have
libs without sources and just want to depend on them.

Will post a few examples on the site in the coming week.

Regards
Mark


>
> Regards
> Arne


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org