Solved

Compiling whit -G option

Posted on 2004-04-20
6
219 Views
Last Modified: 2010-04-01
hi experts

I need to create a library to make a conection whith Java using native interface.

I'm trying to create a source file with -G option but it doesn't work. I use the cc, gcc and g++ but any of that recognize that option.

Any idea about my trouble?

Thanks.
0
Comment
Question by:MauricioGaviria
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10872033
What is -G in your opinion?

On my system the man page lists this:

  -G num
           On embedded PowerPC systems, put global and static items less than
           or equal to num bytes into the small data or bss sections instead
           of the normal data or bss section.  By default, num is 8.  The -G
           num switch is also passed to the linker.  All modules should be
           compiled with the same -G num value.


... and I suspect this is not what you want.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 250 total points
ID: 10872149
This page http://jan.netcomp.monash.edu.au/internetdevices/jni/lecture.html has a pretty short and simple example of how to use JNI with gcc. Are you doing something similar (but more complex)?
If so, try the example and see if your process is wrong. If this example is not comparable to your project, please post more information.
0
 
LVL 3

Expert Comment

by:gkatz
ID: 10877357
I'm not sure why you need the -G option.  I've compiled native interface code to work with java using the CC compilier.  The sun webpage gives an example using
cc -I<where jni.h is> -L<where libjava.so is> -ljava myfile.c

Also if you are running a solaris machine you need to set your LD_LIBRARY_PATH  to point to libjava.so and when you create your new library you need to add the directory that holds that to your LD_LIBRARY_PATH also.  

Hope it helps.  If you are still running into trouble please post why you are using the -G option for making your library.  

Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
max float value 3 77
Are the two lines the same? If not what is the difference? 2 31
Need some help with mailto 16 45
cmake and message 1 27
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question