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

Compile failed after adding Segment.h #6

Open
Kamilton opened this issue Apr 2, 2024 · 2 comments
Open

Compile failed after adding Segment.h #6

Kamilton opened this issue Apr 2, 2024 · 2 comments

Comments

@Kamilton
Copy link

Kamilton commented Apr 2, 2024

Arduino version:
Version: 2.3.2
Date: 2024-02-20T09:57:46.613Z
CLI Version: 0.35.3

Copyright © 2024 Arduino SA

Segment 3.0.0 installed

I got compile error after including Segment.h in my sketch:

/Users/kamilton/Documents/Arduino/libraries/Segment/src/Segment.cpp:53:203: error: default argument given for parameter 17 of 'Segment::Segment(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, bool)' [-fpermissive]
Segment::Segment(int sega1, int sega2, int segb, int segc, int segd1, int segd2, int sege, int segf, int segg1, int segg2, int segh, int segi, int segj, int segk, int segl, int segm, bool cathode = true){ // 16seg, no dp
^
In file included from /Users/kamilton/Documents/Arduino/libraries/Segment/src/Segment.cpp:9:0:
/Users/kamilton/Documents/Arduino/libraries/Segment/src/Segment.h:35:5: note: previous specification in 'Segment::Segment(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, bool)' here
Segment(int sega1,
^~~~~~~
/Users/kamilton/Documents/Arduino/libraries/Segment/src/Segment.cpp:90:214: error: default argument given for parameter 18 of 'Segment::Segment(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, bool)' [-fpermissive]
Segment::Segment(int sega1, int sega2, int segb, int segc, int segd1, int segd2, int sege, int segf, int segg1, int segg2, int segh, int segi, int segj, int segk, int segl, int segm, int segdp, bool cathode = true){ // 16seg, dp
^
In file included from /Users/kamilton/Documents/Arduino/libraries/Segment/src/Segment.cpp:9:0:
/Users/kamilton/Documents/Arduino/libraries/Segment/src/Segment.h:53:5: note: previous specification in 'Segment::Segment(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, bool)' here
Segment(int sega1,
^~~~~~~

exit status 1

Compilation error: exit status 1

Happens even for empty sketch:

#include <Segment.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}
@meawplex-plus
Copy link

meawplex-plus commented Jun 19, 2024

I might be late, but I also got your issue!

The problem lies in the Segment.cpp file, where it looks like the developer accidentally left default values in a few overloads for the Segment function. I just fixed this myself by editing the source (which, of course, one should NEVER do unless they absolutely know what they are doing).

I'll send a pull request (if that even gets accepted) and also fork the repo to add this change.

@meawplex-plus
Copy link

Update: Pull request achieved! You can also access my patched version here. Release included.

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

No branches or pull requests

2 participants