DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Buyong H Hussain Guest

    JNI Calling C and Informix


    Dear All,

    I have these program written in Informix7 and C.
    The problem is I need to call both program through Java JNI program.
    Well, below is my steps:

    1.I create java program called Average.java
    2.Compiled using javac Average.java --> got Average.class
    3.Create header file using javah -jni Average --> got Average.h
    4.I created C native program called AverageImp.c
    5.Now the problem is:
    - This C program is linked with Informix object file (lets say Client.4gl/o).
    - ..using fgl_start() and fgl_call() inside fglapi.h include file.

    - Now how do I linked both program and create shared library in
    the system?
    - Do I use cc -G or c4gl -c or ld -G ?
    - Which compiler should I used...C or Informix?

    Please anybody can help me?

    Thanks for your attention.

    -buyong 006-03-9802643-




  2. #2
    Ruchi Dhar Guest

    Re: JNI Calling C and Informix


    I don't remember exact command line arguments but the solution is you have
    to create an position independent object file using C compiler. I think
    you can use ar command in unix to create such position independent object
    file and keep that file in your SHLIB_DIR. I hope this solves your problem.

    "Buyong H Hussain" <buyong@rhb.com.my> wrote:
    >
    >Dear All,
    >
    >I have these program written in Informix7 and C.
    >The problem is I need to call both program through Java JNI program.
    >Well, below is my steps:
    >
    >1.I create java program called Average.java
    >2.Compiled using javac Average.java --> got Average.class
    >3.Create header file using javah -jni Average --> got Average.h
    >4.I created C native program called AverageImp.c
    >5.Now the problem is:
    > - This C program is linked with Informix object file (lets say

    Client.4gl/o).
    > - ..using fgl_start() and fgl_call() inside fglapi.h include file.
    >
    > - Now how do I linked both program and create shared library in
    >the system?
    > - Do I use cc -G or c4gl -c or ld -G ?
    > - Which compiler should I used...C or Informix?
    >
    >Please anybody can help me?
    >
    >Thanks for your attention.
    >
    >-buyong 006-03-9802643-
    >
    >
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links