Thanks for the info!
I added this section in the build.xml:

   <cc name="CC"
       outfile="libIprShellInterface.so"
       objdir="${build.home}/WEB-INF/lib"
       link="shared">
       <fileset dir="${src.home}/com/mot/sps/ipr/common" includes="*.c" />
       <compilerarg value="-G"/>
       <sysincludepath location="${jdk.home}/include" />
       <sysincludepath location="${jdk.home}/include/solaris" />
   </cc>

But when I build I receive:
[cc] "/ccvob/minerva_data/min_web/ipr_files/web_applications/src/com/mot/sps/ipr/common/IprShellInterf
ace.c", line 34: Error: Pointer type needed instead of JNIEnv_.
[cc] "/ccvob/minerva_data/min_web/ipr_files/web_applications/src/com/mot/sps/ipr/common/IprShellInterf
ace.c", line 35: Error: Pointer type needed instead of JNIEnv_.
[cc] "/ccvob/minerva_data/min_web/ipr_files/web_applications/src/com/mot/sps/ipr/common/IprShellInterf
ace.c", line 36: Error: Pointer type needed instead of JNIEnv_.
[cc] "/ccvob/minerva_data/min_web/ipr_files/web_applications/src/com/mot/sps/ipr/common/IprShellInterf
ace.c", line 37: Error: Pointer type needed instead of JNIEnv_.
[cc] "/ccvob/minerva_data/min_web/ipr_files/web_applications/src/com/mot/sps/ipr/common/IprShellInterf
ace.c", line 69: Error: Pointer type needed instead of JNIEnv_.
[cc] 5 Error(s) detected.


Snippet of the c-code:
#include <jni.h>
#include "com_mot_sps_ipr_common_IprShellInterface.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
JNIEXPORT jstring JNICALL Java_com_mot_sps_ipr_common_IprShellInterface_callIprShellInterface(JNIEnv *e
nv, jobject obj, jstring account, jstring machine, jstring command, jstring output)
{
/* Obtain a C-copy of the Java strings */
const char *c_account = (*env)->GetStringUTFChars(env, account, 0);
const char *c_machine = (*env)->GetStringUTFChars(env, machine, 0);
const char *c_command = (*env)->GetStringUTFChars(env, command, 0);
const char *c_output = (*env)->GetStringUTFChars(env, output, 0);


where the compiler complains about the last 4 lines above.


When I compile on the shell (or with make) it works though
(cc -G -I/tools/java/j2sdk1.4.0/include -I/tools/java/j2sdk1.4.0/include/solaris src/com/mot/sps/ipr/common/*
.c -o libTest.so)
My question: which c compiler is used when saying "CC" and how can I set a specific one (if that is the source of my problems)?
I am working on Solaris 8.


Thanks for your help.
Astrid


Harkness, David wrote:


Check out Ant-contrib's cc task:
http://ant-contrib.sourceforge.net/cc.html

I've also seen much mention on this list regarding a cpp task, and it
seems to be part of Ant-contrib (it's mentioned in their developer
mailing list), so maybe it's in an alpha/beta version.

David Harkness
Sony Pictures Digital Networks
(310) 482-4756


-----Original Message-----
From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 1:27 AM
To: [EMAIL PROTECTED]
Subject: how to compile native c code



Hi, I want to include the compilation (and installation) of some native c code into my build.xml. Can someone tell me how or tell me where I can look? Thanks. Astrid


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Reply via email to