Recent Changes - Search:

edit SideBar

UsingECLiPSeWithVisualC

Using ECLiPSe with MS Visual C/C++

Here we assume use of the "Visual Studio Command Prompt" (i.e. all necessary environment variables for Visual Studio are set up). It should be possible to derive the necessary settings for the Visual Studio IDE from this information.

We assume your ECLiPSe installation is at "C:/Program Files/ECLiPSe 6.0/".

ECLiPSe versions older than 6.0#190 come with an include file (C:/Program Files/ECLiPSe 6.0/include/i386_nt/eclipse_cc.h) that cannot be used with MSVC because it contains gcc-specific constructs. A simple solution is to replace it with the file eclipse_cc.cc from the ECLiPSe sources, renamed to eclipse_cc.h. You can download it here: eclipse_cc.h.

Compiling an example

The sub-directory "C:/Program Files/ECLiPSe 6.0/doc/examples" has example C and C++ files. We are going to compile and run eg_cc_test.cc (either go to the example directory, or copy this file to a location of your choice):

First, create an eclipse.lib as follows:

>lib /machine:i386 /def:"C:/Program Files/ECLiPSe 6.0/lib/i386_nt/eclipse.def"

Then compile-and-link your chosen program

>cl /MT /EHsc /I"C:/Program Files/ECLiPSe 6.0/include/i386_nt" eclipse.lib eg_cc_test.cc

In order to run the program, it must be able to find the eclipse.dll and gmp33.dll. You can either copy these from "C:/Program Files/ECLiPSe 6.0/lib/i386_nt", or put that directory into your PATH:

>set PATH=C:/Program Files/ECLiPSe 6.0/lib/i386_nt;%PATH%

Now you should be able to run the compiled code:

>eg_cc_test.exe

which should produce the following output:

 Testing post_goal()
 done
 Answer was X=hello, Y=hello, n=6
 Testing constructors
 [[1.1, 2.2, 3.3, 4.4, 5.5], [1, 2, 3, 4, 5], [99, 104, 97, 114, 115], hello, wor
 ld, 123456, 3.14, five(0, 1, 2, 3, 4), [hello, 6], _104, [](1.1, 2.2, 3.3, 4.4,
 5.5), []([](1.1, 2.2, 3.3, 4.4, 5.5)), []([](1.1, 2.2), [](3.3, 4.4))]
 Testing assignment
 Testing checking and decomposition
 d = 1.1
 n = 1
 n = 99
 s = hello
 a = world
 functor = five/5, n = 2
 end
 WARNING: no handler for event in hello
Edit - History - Print - Recent Changes - Search
Page last modified on March 17, 2012, at 12:13 AM