5.2 Setting Up a Development Environment5.2.1 Under WindowsUsing the built-in text editorIt is recommended to use the built-in editor for developing controller code on the Windows platform. The built-in text editor provides Make... and Make Clean... buttons that make the compilation straightforward. On the Windows platform, Webots internally invokes the MinGW environment for compiling. MinGW is a gcc compatible open source development environment for Windows. Using your own source code editorIt is possible, however less recommended, to use your own source code editor instead of Webots built-in editor. If you choose this option, you will need to install MSYS for compiling the controllers. MSYS is a UNIX-like terminal that can be used to invoke MinGW commands. When building controllers with MSYS, it is necessary that the WEBOTS_HOME environment variable is defined and points to the Webots installation directory. This variable is used by the project's Makefiles to inform the compiler of the location of Webots' libraries and header files. You will also need to add the bin directory of MinGW to your PATH environment variable. MinGW is located in the mingw subdirectory of Webots distribution. When set correctly, the environment variable should be like this:
Once MSYS is installed and the environment variables are defined, you should be able to compile controllers by invoking make (or mingw32-make) in the MSYS terminal. Similarly, it is possible to clean up a directory by invoking make clean (or mingw32-make clean). Using Visual C++Visual C++ is an integrated development environment for C and C++ provided by Microsoft. It includes a C and C++ compiler and a source code editor. Visual C++ project examples are provided in the controllers/braiten, controllers/khepera and controllers/tcpip controller directories. Typically, a new Visual C++ project for Webots should define a correct include path to the Webots include directory and should link the executable file with the Controller.lib file included in the Webots lib directory. Take care to produce an executable file in the specific controller directory, and not in a Debug or Release subdirectory as produced by default by Visual C++. For example, the khepera.exe program should be created in the khepera directory of your controllers directory. Please note that the resulting executable files cannot be executed from Visual C++, as they must be launched by Webots and referenced in the world file. Here is the complete procedure to set up a new Webots controller project under Visual C++ 6.0:
5.2.2 Under LinuxOn Linux, usually you do not need to install development tools because they are often prepackaged in the distribution. Webots will need to invoke the gcc C/C++ compiler and the make utility. If these tools are not installed on you system, please refer to your Linux documentation to install them. We recommend using the Webots built-in source code editor to edit and compile your C, C++, Java or Python source code. 5.2.3 Under Mac OS XOn Mac OS X, you will, just need to install the Developer Tools provided with Mac OS X, in order to to program your controllers in C, C++, Java and Python. The Apple Developer Tools for Mac OS X include the gcc C/C++ compiler, the make command, the javac Java compiler and the python command. We recommend using the Webots built-in source code editor to edit and compile your C, C++, Java and Python source code. ![]() ^ page top ^ |
| E-mail to webmaster | Last updated: | Copyright © 2008 Cyberbotics Ltd. |