Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Preprocessor warning in JNI project
Preprocessor warning in JNI project [message #206572] Thu, 13 December 2007 11:01
Eclipse UserFriend
Originally posted by: 4cs6fcg02.sneakemail.com

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig74C92B7BDA1A7BCE76034633
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

I managed to get a Hello World JNI app working, having both the Java and
C files in one project. The essential part was adding
-Djava.library.path . to the vm arguments, such that System.loadLibrary
found the lib file.

However, the preprocessor does not seem to understand the JNI variables
that are obligatory for the functions called by Java. They look like thi=
s:

JNIEXPORT jboolean JNICALL Java_function_name_in_Java_file

The first three words are marked as a warning:

Syntax error encountered in file: /home/hendrik/workspace/MSO/query.c at
offset: 282.

The offset is indeed the place of the first J in the file. Doesn=E2=80=99=
t the
preprocessor understand lines?

Any suggestions as to how to solve this? I added <java sdk>/include and
<java sdk>/include/linux to the include paths. The latter contains
jni_md.h, which contains

#define JNIEXPORT
#define JNIIMPORT
#define JNICALL

and is itself included from jni.h, which is included in query.h, which
is included in query.c.

Do I have to explicitly include jni_md.h?

TIA, H.
--=20
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


--------------enig74C92B7BDA1A7BCE76034633
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHYVdYe+7xMGD3itQRAsjoAJ9GWTP5ETBwYqNGdYRN2eSLMK7v/gCe L3nS
YVSF1miuMMe4JE6FBaKFKqM=
=Ri3v
-----END PGP SIGNATURE-----

--------------enig74C92B7BDA1A7BCE76034633--
Previous Topic:How to send ctrl+c signal to stop running?
Next Topic:importing file system files
Goto Forum:
  


Current Time: Thu May 01 14:49:09 EDT 2025

Powered by FUDForum. Page generated in 0.03081 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top