ApCoCoA-1:HowTo:Tips for developing (Ap)CoCoA with Eclipse

From ApCoCoAWiki
Revision as of 01:57, 22 December 2008 by S schuster (talk | contribs) (HowTo:Tips for working with Eclipse moved to HowTo:Tips for developing (Ap)CoCoA with Eclipse: Disambiguate between "Using Eclipse as C/C++ Development Tool" and "Using Eclipse as an ApCoCoA GUI".)

Building (Ap)CoCoALib in Eclipse

  • Get Eclipse with the Eclipse C/C++ Development plug-in's (e.g. download from http://www.eclipse.org/downloads/)
  • Uncheck Project > Build automatically, otherwise, every time you save a modified file your project is rebuilt.
  • Get (http://cocoa.dima.unige.it/cocoalib/changelog-0.99.html) and unzip CoCoALib in your workspace. (You should currently rename the folder CoCoALib-0.99xx to CoCoALib-0.99...)
  • Create a new C++ project (e.g., File > New > C++ Project >Makefile Project > Empty Project)
  • Add the include directory to the C++ Include directories (Project > Properties > C/C++ General > Paths and Symbols)
  • Run ./configure, either from the console or with the following Ant code:


<?xml version="1.0"?>
<project name="Demo" basedir="." default="configure">
 <property name="root.dir" value="." />
 <path id="classpath">
   <pathelement location="." />
 </path>
 <target name="configure">
   <exec executable="./configure" dir="${root.dir}">
     <!-- Only needed for ApCoCoA: -->
     <arg value="--with-libconfig=lib.config" />
   </exec>
 </target>
</project>


If Eclipse calls make all before it starts configure, right-click build.xml and uncheck "Build before launch" under "Run As > External Tools Configuration... > Build".

  • Now build the CoCoALib project
  • To build ApCoCoALib, follow the same steps as above. To get the latest sources from the Mercurial repository,
  1. install the Mercurial plug-in (Help > Software Updates > Available Software > Add site... : http://www.vectrace.com/eclipse-update/)
  2. Create a new project with the Mercurial "Clone..." wizard.
  3. Convert the newly cloned project to a C / C++ Project
  4. Add the include directories from CoCoALib and ApCoCoALib.
  5. Run configure and build the project as above.

Code completion troubleshooting

Code completion does not work and my editor window has a gray background

In this case it could be that you are currently working within a #ifdef SOME_SYMBOL block and the symbol SOME_SYMBOL has not been declared within your Eclipse project. Symbols can be declared by clicking on Project -> Properties -> C/C++ General -> Paths and Symbols -> Symbols. Be sure to declare the symbol for the correct programming language (e.g. "GNU C++"). ==General search and completion issues

  • Make sure to have a CoCoALib project in addition to your ApCoCoA project and set

Mercurial plugin troubleshooting

Linux specific problems

In at least one case, it was not possible to push changes into a repository if Eclipse had not been started from a shell. The reason for this was that the password entered into the password form of the Eclipse Mercurial plugin was ignored and had to been entered manually in the shell instead. It might be worth noting that the password entered in Eclipse was shown in clear text in the shell as well.

Push fails

There are several (unconfirmed) reasons why this might happen.

  • Using a ssh connection: Eclipse has not been started from a shell under Linux. Please see section above. (?)
  • Wrong path to repository. In this case the Eclipse error message is very precise.