Re: eclipse clp prolog C code generation query



jitender001001@xxxxxxxxx wrote:
i have compiled program doc/examples/eg_c_basic.c like this

[anonymous@localhost Eclipse_5.10_103]$ gcc -g -Iinclude/i386_linux
doc/examples/eg_c_basic.c -Llib/i386_linux -leclipse

and it got terminated in ec_init()

so plz tell how can i compile it in tkeclipse ?

thanks
Hi,

You asked about this about a month ago in the comp.constraints Newsgroup. I replied to you then, and suggested for such ECLiPSe-specific question, you might want to use the ECLiPSe mailing list at:

http://www.eclipse-clp.org/mailman/listinfo/eclipse-users

I asked several questions in my previous reply to you: I asked if you could run tkeclipse. It seems that you can -- this calls ec_init(), like in the example program you are compiling above. So it seems that ec_init() works, so the problem is not with your ECLiPSe system.

From the way you are compiling your example above, and if you run the resulting a.out from your <ECLiPSe> (where <ECLiPSe> is where you placed ECLiPSe) toplevel directory, you need to set LD_LIBRARY_PATH environment variable to include <ECLiPSe>/lib/i386_linux when you run the a.out executable. This seems to be the most likely reason why you are having problems running the a.out.

However, you should get an error message if LD_LIBRARY_PATH was not set correctly:

kish@bodgerix:~/Eclipse> a.out
a.out: error while loading shared libraries: libeclipse.so: cannot open shared object file: No such file or directory

but in your previous postings, you said you did not get any messages. I am not sure why this is so.

As for your specific question about `compiling C programs in tkeclipse', there may be some confusion here -- you can embed ECLiPSe into a C program, which you compile and run -- this is what the example you are trying to compile, and also tkeclipse, is doing. So you don't compile a C program from tkeclipse as such.

On the other hand, you can call C from within ECLiPSe, by calling `external' predicates that are written in C. You can do this from any ECLiPSe, but this is not what you are trying to do.

Cheers,

Kish
.



Relevant Pages

  • Re: eclipse 3.0 - dose it support jdk1.5.0?
    ... >>Thje main concern of mine is that eclipse will compile and run all new ... Eclipse really should have allowed an easy entering of an external ... The jGRASP 1.7.1 release added more support for Java 1.5 features. ... generation now fully supports Java 1.5 syntax. ...
    (comp.lang.java.help)
  • [Eclipse 3.3 + Ant 1.7] Classpath length on Windows XP
    ... I'm using Ant from within Eclipse to build a project on developer ... and accordingly define two targets "compile" ... classpath argument of the task. ...
    (comp.lang.java.softwaretools)
  • Re: How To Get Rid Of Problems In Problem Console Window
    ... It's got an Ant ... > build.xml that can compile and build the app without any compilation ... > according to Eclipse, is to import CommandException into the offending ...
    (comp.lang.java.softwaretools)
  • Re: Why doesnt C# allow incremental compilation like Java?
    ... to touch the files which have changed and any dependencies. ... The former seems to eliminate 99% of compile errors to me. ... Eclipse will let you run code even if you've still got ... Class libraries and forms, or class libraries and web services, ...
    (microsoft.public.dotnet.languages.csharp)
  • Compile Matlab Engine in Eclipse
    ... I'm having a little difficulty compiling the matlab engine the eclipse ... I'm using the mingw toolchain to compile my program on win xp. ... this is the only matlab function i'm try to run right notw and is in a ...
    (comp.soft-sys.matlab)