Society of Robots - Robot Forum

Software => Software => Topic started by: Hero I on September 27, 2014, 10:49:05 PM

Title: Does "Webbotlib Studio" only generate C++ code?
Post by: Hero I on September 27, 2014, 10:49:05 PM
In "Project Designer", the user is allowed to choose between generating C or C++ code in the "Generate Project code" window.

Does the user have the same option in "Webbotlib Studio"?

If so, where? I can't find it.
Title: Re: Does "Webbotlib Studio" only generate C++ code?
Post by: Webbot on September 28, 2014, 11:36:29 AM
WebbotLib Studio only generates C++ code.
There are lots of reasons for this:- as other 3rd parties can now contribute code then it is very difficult to make sure that every contributor uses unique names for all their functions. C++ namespaces help with this.
Does that mean you have to write your project code in C++? Well not really. Since C++ is a superset of C then you can still use C for your main code - but when accessing sensors/devices then use C++ syntax such as LeftMotor.setSpeed(20). After all this is exactly how other things like Arduino work.
Webbot