Using gcc (in Cygwin) for JNI - resource.h not found. drand48 not found

Hello,
I am trying to use gcc for JNI. I have successfully executed simple programs like Hello World and Message Box. Now I have a C project that I am trying to use in JNI (Its FOIL 6.4 by Quinlan).
I have written the .java file and the .c (wrapper) file and am calling the top level function from FOIL. Whenever I try to run it I get several errors.
sys/resource.h: No such file or directory.
/tmp/ccGi67I4.o:state.c:(.text+0x4cb): undefined reference to `_drand48'
/tmp/ccGi67I4.o:state.c:(.text+0x85a): undefined reference to `_drand48'
I have the resource.h file in C:\cygwin\usr\include\sys but it still doesnt find it.
And drand48 is present in one of the include files, but it still gives me this error.
the way I use gcc to create the dll is:
$CYGWINBIN/gcc-3.exe -mno-cygwin -I$jdk/include -I$jdk/include/win32 -Wl,--add-stdcall-alias -shared -o foilJNI.dll foilJNI.c global.c main.c input.c output.c state.c literal.c evaluatelit.c search.c determinate.c order.c join.c utility.c finddef.c interpret.c prune.c constants.c
where $CYGWINBIN is C:\cygwin\bin
and $jdk is C:\Java\jdk1.6.0_20
Can anyone please tell me where the problem is.
Any suggestions are welcome.
Thanks
Nick

lahscin wrote:
(Its FOIL 6.4 by Quinlan).
Any suggestions are welcome.You want to do some task using a C library and then interface that to java.
Two parts, not one.
So
1. Define the task. This has nothing to do with code (java or C.)
2. Write C code that represents a library/API to achieve that task. This has nothing to do with java nor JNI.
3. Unit test 2 until it works.
4. Write JNI code to use the API from 2. This involves JNI/java.
Until you reach step 4 none of your questions have anything to do with JNI/Java. So you ask them on C forums, C compiler forums and forums specific to the library you are using.

Similar Messages

  • We have 2 itouchs, we a separate itunes account for each one. We have one home computer to use them both on for syc and icloud, the icloud will not accept the 2 accounts?

    we have 2 itouchs, we a separate itunes account for each one. We have one home computer to use them both on for sync and icloud, the icloud will not accept the 2 accounts?

    Do you know what happens if you delete the icloud account from an iphone 4s?  Will it delete the pictures, documents, etc. from the phone, or just unlink the icloud from the phone?  I want to associate a different icloud account to the phone.

  • HT1420 i used 3 old computers for my itunes account that i do not have ANY ACCESS with anymore, that i want to de-authorize.... can i do that without the computers and does it wipe out my existing computer at the same time?????

    i used 3 old computers for my itunes account previously, that i have no access to de-authorize now..
    can this still be done with my existing computer, and does it de-authorize the current one, so that i would have to re-load it????
    the original 3 computers are long gone, in-active....

    Individual computers can only be deauthorised directly on them, but as you have more than one computer authorised then you can log into your account on your computer's iTunes via the Store > View Account menu option and 'deauthorise all' (which you can do once every 12 months) and you can then authorise/reauthorise the computers that you still have and need. Deauthorising a computer doesn't remove any content from it, it just means that you won't be able to use any of the account's downloads on it until you reauthorise it.

  • I need to use a plug in for an internet program, but it will not open in Adobe

    Its for a poker website and it keeps saying its not found in Adobe

    See if Deltagraph is still around.  We used to use that for plotting scientific data on Macs.  I don't know if it is at all transferrable with Sigmaplot if you have a colleague who uses it, but if you're doing this on your own I would look at getting DG vs, doing a dual boot  etc.

  • Using java to listen for a keypress when the program is not in focus

    I want to set up a program where no matter what other program I'm using, when I press Ctrl+F1 my program will take focus and run another function or two. Is this possible and if so how can it be done?
    Thanks.

    Ok Mr. Smartass...Ok
    I'm building a browser that is always open, and when
    a user presses Ctrl+F1 (notice, just those two keys,
    I don't care what else they press...) the browser
    will open up. That way, you don't have to wait for it
    to load all the time.You have two ideas here. One is having a universal key map that always gets ctrl-f1 sent to your app. The other is a program that is constantly running so that you don't have to wait for it to open up. The former is not possible (and this is a good thing) As warneria and I have been saying, it is bad design for an app to try to force an OS to implement this kind of feature.
    If you're not going to help please don't post at all;
    it's a waste of time for both you, me, and anyone
    else who may need help on the same subject. Why wouldBelieve it or not, I am helping you.
    See
    http://www.google.com/search?hl=en&lr=&q=programming+code+side+effects
    and
    http://www.faqs.org/docs/artu/ch04s02.html
    "Doug McIlroy's advice to �Do one thing well� is usually interpreted as being about simplicity. But it's also, implicitly and at least as importantly, about orthogonality."
    anyone in their right mind who's trying to steal
    people's passwords come out and say, "I'm not trying
    to steal people's passwords!"wait, your question is why would someone trying to steal passwords say I'm not trying to steal passwords? I think duplicitous people in their right minds might try to trick you that way.
    Beyond that, even if you're not a malicious hacker - and I am sure you are not - if someone posts a solution to your problem, malicious coders then will have learned how to do it. If you think you're programming or using these forums in a bubble, you are not.

  • Creating shared library of native method implementation using gcc

    Hi
    I am using Dev-C++ IDE for writing and compiling C Programs. It supports gcc.
    I have to build a shared library of a native method implementation using gcc compiler.
    In JNI tutorial build script is given for VC++ which is as follows
    cl -Ic:\java\include -Ic:\java\include\win32
    -LD HelloWorldImp.c -Fehello.dll
    Similarly I wanted build script for gcc compiler.
    Thanks
    Shailesh

    Here is an example of building a library from one module with CygWin's gcc:
    # Must set JAVA_HOME and LIBRARY_MODULE before
    gcc -mno-cygwin -D__int64="long long" -I $JAVA_HOME/include/win32 -I $JAVA_HOME/include -shared -Wl,--kill-at -o $LIBRARY_MODULE.dll $LIBRARY_MODULE.c

  • How to compile a dll for JNI in the CMD correctly

    Now I find alot of old threads on using the mno command in cygwin to created dlls to use as an interface between c and Java, however I know this command is no longer available in cygwin and so I took the advid of downloading minGW and using this in the CMD instead.
    However every example I try to compile and run this way throws the unsatified link error when the native function is to be called by the Java program. I believe it must be a compiling error creating a mismatch between the native function and the function to be called.
    Here is the method I'm using to comile dlls for JNI, it is from the FAQ section of the minGw website:
    gcc -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at
    -Ic:/j2sdk1.4.1_02/include -Ic:/j2sdk1.4.1_02/include/win32
    -shared someJavaImp.c -o JavaImp.dll
    Is this how dll should be compiled? If not any suggestions?

    sudsey wrote:
    I know how to program well in C and Java, I just need to know the proper way to compile a dll for JNI.1. Get the MS IDE
    2. Create a dll project - it must NOT be a managed dll
    3. All done.

  • Compiling Tuxedo Sample Application on Sun using gcc

    We have installed Tuxedo 8.0 on Sun 8.0 and using gcc 3.1 for compilation.
    While compiling Tuxedo sample application, we are receiving an error gcc: language
    arch=v9 not recognized
    Are we supposed to do something more to be able to use gcc for compiling Tuxedo
    sample application.

    try turning off the language specification using -x none option.
    see gcc documentation for this option.
    "Sudhir" <[email protected]> wrote:
    >
    We have installed Tuxedo 8.0 on Sun 8.0 and using gcc 3.1 for compilation.
    While compiling Tuxedo sample application, we are receiving an error
    gcc: language
    arch=v9 not recognized
    Are we supposed to do something more to be able to use gcc for compiling
    Tuxedo
    sample application.

  • Loading 64bits librairies for JNI calls

    Hi
    somebody knows if its possible to load 64 bits librairies with LoadLibrary call ???
    I'am trying on HPUX 11.11 64 with Java 1.3.1 and its impossible.
    I have read on
    http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html
    that i'ts impossible to load 64b librairies, only 32
    Is it true for all OS (Solaris etc ) ??
    Is it true for all Java version (1.3, 1.4) ??
    Do i need to try with 64b JVM ??
    Jean de Ratuld

    It's the same with System.load !!!!
    I've made a trace of system call's with a "truss" like command.
    the library is correctly founded and loaded but the JVM
    throw an Exception.
    I've red on this web page:
    http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html
    that
    "The Java Native Interface, typically referred to as JNI, is a standard native method interface that allows Java to call up native libraries written in other languages. (Java is a 32-bit language, so you can't use 64-bit libraries with JNI.) "
    I think it's not possible to load 64b libraries !!
    thanks for your help
    Jean de Ratuld

  • I am using my first apple product, mac book pro.  somehow i FIGURED OUT HOW TO INCREASE THE FONT FOR SEARCHES AND WEB PAGES, BUT THE FONT IS TOO BIG AND FOR THE LIFE OF ME I CAN NOT FIND WHERE TO GET THE SCREEN BACK TO NORMAL, HELP ANYONE?

    I am new to Apple, somehow I figured out how to make font of Web pages bigger, but it is too big and I can't use sites properly.  for the life of me I can not how to get my font size reduced.  Help anyone? thank you, sbb

    Probably command-minus will do the trick.

  • Using one logical partition for / and /boot

    Hi
    on my pc i have windows and a linux. i want to install Arch and have all of them. there are some windows (ntfs) partition on my hard disk, a swap area and 2 linux partition that one of them is used by ubuntu (/boot, / , /home .....of ubuntu are in one partition which is ext4). is it possible to use the same method for Arch? i mean , i do not want to have a seperate /boot partition for Arch. is it possible? if yes, what is the recommended file system for that partition? can i use ext4? (some distroes do not support booting from an ext4.)
    Regards

    You can use one partition for arch, with no separate /boot, and arch can boot from ext4.

  • Best practice: Using break statement inside for loop

    Hi All,
    Using break statment inside FOR loop is a best practice or not?
    I have given some sample code:
    1. With break statement
    2. With some boolean variable that decide whether to come out of the loop or not.
    for(int i = 0; i < 10; i++){
    if(i == 5){
    break;
    boolean breakForLoop = false;
    for(int i = 0; i < 10 && !breakForLoop; i++){
    if(i == 5){
    breakForLoop = true;
    The example may be a stupid one. But i want to know which one is good?
    Thanks and Regards,
    Ashok kumar B.

    Actually, it's bad practice to use break anywhere other than in conjunction with a switch statement.Presumably, if you favour:
    boolean test = true;
    while (test)
      test = foo && bar;
      if (test)
    }overfor (;;)
      if (! ( foo && bar) ) break;
    }then you also favour
    boolean test = foo && bar;
    if (test)
    }overif (foo && bar)
    }Or can you justify your statement with any example which doesn't cause more complexity, more variables in scope, and multiple assignments and tests?

  • After I updated iOS 5 can´t use the "open with" for mail attachments.

    After I updated iOS 5 on my iPad 2, I can not use the "open with" for mail attachments. The option is not appearing.
    For example, when I try to open an .wmv attachment the iOS 5 doesn´t show "open with". Before update, I was able to open with "AZUL" software.
    Can anyone help me?

    You did say that the option does not appear at all in mail no matter which file type you want to open correct? I can only assume that something went corrupt in the update that affected your settings and that's why this option no longer appears. For experimental purposes, you could try emailing a PDF to yourself and see if that will allow you to use the Open in function in the mail app.
    If nobody else jumps into this discussion with a different idea, then maybe you should try restoring your iPad. The best way to do so is - first backup the device - and then restore to factory settings and then you can try restoring from a backup at the end of the process.
    However, if one of your settings is corrupt, the backup will be corrupt as well. It may be that you will have to restore to factory settings and then start all over again - adding your apps and content back to the device to get the best results. I would certainly use this process as a last resort. Restoring from a backup maybe all that you need to do.

  • Can LabView 2013 be used to develop blocks for Lego LabView Education EV3?

    I would like to interface some custom sensors to the Lego EV3 brick. Can LabView 2013 be used to build Blocks for Lego LabView EV3 software?

    Please note Mac OSX users using LabView 2013 Student Edition -- you CAN use the new EV3 modules but you must install f1 patch first. 
    I installed NI LabVIEW 2013 LEGO MINDSTORMS NXT Module f1 Patch.
    Then 
    NI LabVIEW 2013 Module for LEGO MINDSTORMS f2 Patch
    Now I can program for LEGO EV3, download to EV3 and it works all from the LV 2013 Student Edition (UK).
    Dr. Michael Vallance
    Future University, Japan.
    Homepage http://www.mvallance.net
    International Virtual Environments Research Group (iVERG) http://www.iverg.com

  • Cannot use file for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Serve

    Hi
    Windows serv 2012 cluster on sql 2012 cluster with 2 instance. on works fine , Second instanc ewhen i try to creat DB a get this message. 
    Cannot use file  for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql
    Server does not have a dependency on it.
    CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5184)
    Any help please
    kam
    KAMEL

    Hi Saurabh
    Exactly I have SQL SERVER 2012
    Failover Clustering   in windows server 2012 with two nodes with
    two instances and exactly I run them in the same server and each instance with
    three drives Backup, Data and log.   
    KAMEL

Maybe you are looking for

  • How to I get back to the page I was reading after looking at a bookmarked page?

    How to I get back to the page I was reading after looking at a bookmarked page? (And, why is "Help" in Adobe products such a useless, time-wasting ordeal?)

  • IPad 4 with iOS 8 "read list" doesn't work

    After updating to iOS 8, read list  feature in Safari doesn't work animore!!!((( I can not read articles without the intertnet! And also, Apple, come on, make iWork for free for rest of you costomers! It's ridicules to pay 30$ just only because that

  • Error code 50 when copying cd to itunes

    When downloading music from CD to itunes I keep getting error code 50.  My download .tmp folder is empty.  Does anyone have a solution?

  • Driver for lexmark 5470 printer

    after upgrading to 8.1, i cou;ld not get driver for printer.

  • Can't Write XMP Files

    I'm using Windows XP and LR 1.3.1 and I can't seem to write a specific folder of files. I'm trying to create the XMP files so I can do a global edit to modify the Lense type. When I select all and then click on Save Metadata to Files, the program doe