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

Conflicting declaration #6

Open
MyNameIs-Nigel opened this issue Dec 21, 2020 · 2 comments
Open

Conflicting declaration #6

MyNameIs-Nigel opened this issue Dec 21, 2020 · 2 comments

Comments

@MyNameIs-Nigel
Copy link

Hey! I was following your flashing tutorial on YouTube and found an issue that I am having. I can not compile the code because of an exit. "conflicting declaration 'typedef struct UPosition UPosition'"

How do you think I could go about resolving this issue? Here are the steps I followed to ensure you can run into this error:

  1. Download the code from the github
  2. Download arduino, rename the keebcard-master to keebcard
  3. Open Keebcard.ino
  4. Add TinyWireM.h and Tiny4kOLED.h libraries
  5. Comment #define TETRIS and uncomment #define PONG
    Compile the code.

These are the exact steps shown in the video (to my memory) and resulted in the following error: (Info and such included in the error message)

Arduino: 1.8.9 (Windows 10), Board: "ATtiny25/45/85, ATtiny85, Internal 1 MHz"

In file included from C:\Users\Nigel\Desktop\keebcard\Keebcard.ino:21:0:

Tetris.h:13:3: error: conflicting declaration 'typedef struct Position Position'

 } Position;

   ^

In file included from C:\Users\Nigel\Desktop\keebcard\Conway.cpp:2:0:

sketch\Conway.h:12:3: note: previous declaration as 'typedef struct Position Position'

 } Position;

   ^

exit status 1
conflicting declaration 'typedef struct Position Position'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
@MyNameIs-Nigel
Copy link
Author

Heyy! I just noticed I posted the Wrong error code! My bad!! Still, similar enough error. This error occurs on every one I have found.

Here is the updated error.

Arduino: 1.8.9 (Windows 10), Board: "ATtiny25/45/85, ATtiny85, Internal 1 MHz"

In file included from C:\Users\Nigel\Desktop\keebcard\Keebcard.ino:25:0:

Pong.h:7:3: error: conflicting declaration 'typedef struct UPosition UPosition'

 } UPosition;

   ^

In file included from C:\Users\Nigel\Desktop\keebcard\Conway.cpp:2:0:

sketch\Conway.h:7:3: note: previous declaration as 'typedef struct UPosition UPosition'

 } UPosition;

   ^

In file included from C:\Users\Nigel\Desktop\keebcard\Keebcard.ino:25:0:

Pong.h:12:3: error: conflicting declaration 'typedef struct Position Position'

 } Position;

   ^

In file included from C:\Users\Nigel\Desktop\keebcard\Conway.cpp:2:0:

sketch\Conway.h:12:3: note: previous declaration as 'typedef struct Position Position'

 } Position;

   ^

exit status 1
conflicting declaration 'typedef struct UPosition UPosition'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@MyNameIs-Nigel
Copy link
Author

Hey there! I deleted everything except the necessary files and pong. So this leaves Keebcard, Pong.cpp, Pong.h, and settings.h.

Now it will compile.

Still not sure, is this a necessary step? As to my knowledge, you do not include this step in your video..

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

1 participant