I tried to compile the demonstration program genieParticle_Demo using Particle Inc’s WebIDE and the genieParticle library.It will not build and returns 4 errors in the .cpp file
lib/genieParticle/genieParticle.cpp:658:1: no return statement in function returning non-void [-Werror=return-type]
lib/genieParticle/genieParticle.cpp:839:11: call of overloaded ‘abs(long unsigned int&)’ is ambiguous
lib/genieParticle/genieParticle.cpp:942:1: no return statement in function returning non-void [-Werror=return-type]
lib/genieParticle/genieParticle.cpp:568:1: control reaches end of non-void function [-Werror=return-type]
I have been advised that the missing return statements are serious coding faults that were previously reported as errors but which are now treated as fatal errors.
Have these coding errors been fixed in the github repository? Is the code in the Particle library up to date. If so, how do I go about getting the code fixed so that I can proceed with development.
When you click the SHOW RAW button in the error section of Web IDE, you may find further info, what exactly the compiler cannot resolve with that ambiguous abs() call.
There may be several implementations but none for long unsigned int&. So the compiler must perform an implicit type conversion but cannot decide which will fit your needs best. You may want to change/cast the data type you feed into that function to solve that conundrum for the compiler.
BTW, there is little use in calling abs() on an unsigned variable anyhow, so it’s no surprise that there is no overload that would take an unsigned whatsoever
As for fixing the errors in the repository:
Many of the libraries in the Particle library repository are contributed by private individuals or 3rd party entities. If they provide a GitHub link you could file an issue report on their repository.
To fix these errors yourself, you can add a set of library files via the button in the to right corner of Web IDE.
Name the files accordingly and copy/past the contents of the library sources to them and edit as needed.
Don’t forget to remove the library reference from your project
@ScruffR Thanks for your prompt replies to my two related questions - apologies, I mistakenly posted this query on the Particle forum instead of the 4DSystems forum. 4DSystems developed the genieParticle library and I am hoping that they have or can fix these issues. Failing that, I will have a go but I am a novice, most of my experience being with Fortran in the 80’s. The software world has come a long way since then.
I suspect that these driver bugs existed when I developed a medical instrument for my son’s PhD program a few years ago but were not recognized at the time. I was lucky they did not cause any problems. We are now developing an enhanced version funded by a charity but I am stuck until I can get this library issue rectified. I will be in touch with 4DSystems in the morning.
Thanks for you ever ready willingness to provide answers to what are frequently my novice questions.
Web IDE has a SHARE THIS REVISION feature, which will take a snapshot of your project and provides you with a link to that snapshot you can then share with others who can create a copy of that project to see what exactly is going on and may also be able to solve the problem and share that back to you again.