|
From: Jean P. D. <dav...@vi...> - 2004-08-02 17:41:24
|
Hi every one,
=20
with this it worked
compiler compiler C++
linker(=E9diteur de lien)
-DBUILDING_DLL=3D1 -DBUILDING_DLL=3D1
--no-export-all-symbols --add-stdcall-alias
=20
but I still have dllwrap.exe: no export definition file provided. ???
=20
=20
Jean Pierre Daviau
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D IN JAVA file
=20
static
{
System.loadLibrary("tn");
}
=20
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D for reference =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
I red the doc and other things. They all talk about the command lines.
=20
I tried to put command lines exerps in compiler parameters and=20
make parameters without success.
for example
-shared -o mydll.dll mydll.o
gcc -o myprog myprog.ca -L./ -lmydll
etc.
=20
=20
If I create a dll windows project. The winmain reference is added.
As you can see there is no main in the c file because it is caled by the
main in Java.class.
here is the output of the compiler in DEVC++
=20
---
=20
Compilateur: Default compiler
Building Makefile: "C:\Documents and Settings\Jean
Pierre\Bureau\DEVC++\checkRegistration\Makefile.win"
Finding dependencies for file: C:\Documents and Settings\Jean
Pierre\Bureau\DEVC++\checkRegistration\serie.c
Ex=E9cution de make...
make.exe -f "C:\Documents and Settings\Jean
Pierre\Bureau\DEVC++\checkRegistration\Makefile.win" all
windres.exe -i serial_private.rc -I rc -o serial_private.res -O coff
--include-dir C:/JDK11~1.8/lib
=20
dllwrap.exe --output-def libserial.def --implib libserial.a serie.o
serial_private.res -L"C:/Dev-Cpp/lib" -L"F:/unzipM_soft/w32api-2.0/lib"
-L"C:/jdk1.1.8/lib" -L"C:/jdk1.1.8/bin" --no-export-all-symbols
--add-stdcall-alias -o serial.dll
=20
dllwrap.exe: no export definition file provided.
Creating one, but that may not be what you want
=20
Ex=E9cution termin=E9e
Compilation OK
=20
____
=20
=20
=20
#include "Serial.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#define JNI_FALSE 0=20
#define JNI_TRUE 1=20
=20
char alphabet[] =3D "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ "
"abcdefghijklmnopqrstuvwxyz_-";
const int alphas =3D sizeof alphabet - 1;
=20
JNIEXPORT jstring JNICALL Java_Serial_numero
(JNIEnv *env, jobject jobjc, jstring jstr){=20
jthrowable exc;
jboolean iscopy;
jstring ret;
jsize len;
int i, j;
const char *fmt;
char ligne[11];
=20
fmt =3D (*env)->GetStringUTFChars(env, jstr, &iscopy);
len =3D (*env)->GetStringLength(env, jstr);
=20
printf("The string '%s' received by C has %d characters.\n", fmt, len );
=20
for(i=3D0;i<11;i++){
for(j=3D0;j<alphas;j++){
if(alphabet[j] =3D=3D fmt[i]){
printf("%2d- %c ",i, fmt[i]);
ligne[i] =3D alphabet[65-j];
printf("%c\n", ligne[i]);
/*printf( "Completed set, checking for exceptions..\n" );*/
exc =3D (*env)->ExceptionOccurred( env );
break;
}
=20
=20
}
}
ligne[11] =3D '\0';=20
=20
printf("The string mixed by C is : %s\n", ligne);
=20
ret =3D (jstring)(*env)->NewStringUTF(env, ligne);
(*env)->ReleaseStringUTFChars(env, jstr, fmt);
if (exc)
{
printf( "Exception detected..\n" );
(*env)->ExceptionDescribe( env );
(*env)->ExceptionClear(env);
}
return ret;
}
=20
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|