Cbridge setup
Inhaltsverzeichnis
CBridge Setup[Bearbeiten]
In order to compile and execute C/C++ actions, a C compiler toolchain has to be installed on the machine, where the cBridge.exe runs. Typically this is the local machine on which expecco runs, but it may be any other machine in yiur reachable network. The CPU architecture and or operating system may also be different from the CPU which executes expecco.
The C-code is compiled on the target machine (i.e. not cross-compiled).
C-COmpiler Toolchain Installation[Bearbeiten]
Windows + Borland Compiler (32bit)[Bearbeiten]
The compiler is a bit outdated, but still free. We recommend to install the toolchain at its default installation path (typically "C:\borland").
Windows + MINGW Compiler (32 or 64bit)[Bearbeiten]
The mingw toolchain is based on the gcc compiler. This is recommended and preferred over borland.
Windows + Microsoft Visual C / Visual Studio[Bearbeiten]
There is no need to install the full Visual Studio IDE. Only the C-compiler, linker and libraries are required. Thus, you can untoggle all assitional optional packages during the installation.
Unix / Linux[Bearbeiten]
Install whatever packages are required; check if the "cc" command is found along your PATH (before starting expecco), or alternatively, remember the path to the "cc" command.
Regardless of which compiler you use, please remember the installation path. You will need it later unless the compiler is found along your PATH settings.
Quick Check if it already works[Bearbeiten]
We provide a number of setups for common installations. In many situations, this will already be correct for your setup.
To check, create a new elementary-bridgedC action, and run it.
If you get a green OK result, you're already deon. If not, your setup needs to be adjusted.
The compile script[Bearbeiten]
For compilation, the cBridge.exe program calls a batch/shell script, which is responsible for compilation of the C-code to a DLL/shared object file. This script may need to be edited. We recommend, that you navigate to the folder where the cBridge.exe is located, take one of the existing scripts as template, make a copy under a new name, and then edit this copy to suit your needs.
Take one of the existing scripts which uses the same compiler (borland/mingw/visualC).
In the editor, check the PATH setting, and edit it as appropriate, finally save it.
Back in expecco, got to the external-script settings, then the cBridge settings, and change the CC-script setting there.
Shutdown any alrady running bridge (Extras - Debugging - Shutdown all Bridges)
Go back to the C-action and repeat the quick check.
Eventually, you should see a green OK result.
Special additional Libraries[Bearbeiten]
It may be required that you C-code needs additional shared libraries to be linked against your code. The easiest is to add those libraries and corresponding command line options to the CC-script's compiler call command. The details depend on the compiler used. You may need to do a "cc --help", "cl/help" or similar, to figure out which command line options are required.