Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo.h clashes with servo.h #154

Open
BloodWorkXGaming opened this issue Feb 26, 2019 · 11 comments
Open

Servo.h clashes with servo.h #154

BloodWorkXGaming opened this issue Feb 26, 2019 · 11 comments
Assignees
Labels
Milestone

Comments

@BloodWorkXGaming
Copy link

The simpletools library servo.h can't really be used as there is a Servo.h library as well.
It is very mixed when which one gets included as the only difference is the capital S. (Works on one PC, doesn't on the other)

@DavidZemon DavidZemon self-assigned this Feb 26, 2019
@DavidZemon DavidZemon added the bug label Feb 26, 2019
@DavidZemon DavidZemon added this to the Version 3.0 milestone Feb 26, 2019
@DavidZemon
Copy link
Collaborator

Oohhhh.... Oh Microsoft. That's annoying, for sure. Okay, I'll add a CMake option (which will default to OFF) to include Arduino's Servo.h (I'm guessing that's where the other one is coming from)

@BloodWorkXGaming
Copy link
Author

Awesome, thanks!

@DavidZemon
Copy link
Collaborator

You're not trying to use both Simple and libPropelleruino, are you?

DavidZemon added a commit that referenced this issue Feb 28, 2019
This also fixed a bug where components were not actually usable
DavidZemon added a commit that referenced this issue Feb 28, 2019
This also fixed a bug where components were not actually usable
@DavidZemon
Copy link
Collaborator

@BloodWorkXGaming, please try downloading the version of PropWare available in either of the two builds linked above (click the green checkmark to get a link to the build on the CI server). This will let you test the change prior to me merging it in.

@BloodWorkXGaming
Copy link
Author

Well, yes, I am using both simple and libpropeller. Is there anything wrong with that?
serial.h from libpropellor (as that is waaaay better than fdserial from simple) and abdrive360 + servo.h from simple as there is no equivalent in libprobellor for that.

Will the new commits and come back to you, thanks!

@BloodWorkXGaming
Copy link
Author

Okay, so just tested the build but it sadly doesn't fix the issue.
As all subdirectories are roots for the import it doesn't really change much as the compiler still can't decide.
If I could do something like #include "Simple/servo.h" that might help.

Also, due to those changes there is now a PropWare/PropWare and a Libpropeller/libpropeller folder

@DavidZemon
Copy link
Collaborator

I forgot a pretty critical part: replace find_package(PropWare REQUIRED) with

find_package(PropWare REQUIRED
    COMPONENTS Simple LibPropeller PropWare ArdionoJson)

This will exclude LibPropelleruino (note: not libPropeller) which has Servo.h. The extra level of directories is necessary for CMake to have this kind of control. And though you and I would be fine with <simple/simpletools.h>, it would completely break compatibility with code written in SimpleIDE and the Simple itself (look at the include lines in simpletools.h and you'll see what I mean).

Also, keep this in mind if you ever write your own library... Make sure the headers are in a subdirectory with some kind of distinguishing name.

@BloodWorkXGaming
Copy link
Author

Okay with the new line in there I get the error

  PropWare's LibPropeller component not available due to missing
  PropWare::LibPropeller_cog
Call Stack (most recent call first):
  CMakeLists.txt:2 (find_package)

@DavidZemon
Copy link
Collaborator

Ah, that's I get for trying to think at 6am. Try

find_package(PropWare REQUIRED
    COMPONENTS Simple Libpropeller PropWare ArdionoJson)

And of course, the PropWare and ArduinoJson components are optional since you're not using them.

@BloodWorkXGaming
Copy link
Author

Just noticed I am indeed using libpropellerino for the WString.h, so simply excliding it didn't fix it.
Copied the serial.h and serial.c code I needed into my project as a workaround.

@DavidZemon
Copy link
Collaborator

Oh... bummer. Alright, I'll come up with something better (I'm going to leave the componentized folders though, and that's another thing that really should have been done a while ago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants