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

Problem Compiling #4

Open
HotPepperDaddy opened this issue Feb 20, 2017 · 6 comments
Open

Problem Compiling #4

HotPepperDaddy opened this issue Feb 20, 2017 · 6 comments

Comments

@HotPepperDaddy
Copy link

HotPepperDaddy commented Feb 20, 2017

Hi, USaber won't compile for me, I'm wondering if it's a version or compiler issue. I'm just compiling the WT588 player example.

                 from /opt/arduino-1.8.0/libraries/USaber/USaber.h:59,
                 from /home/rob/Arduino/sketch_feb19a/sketch_feb19a.ino:6:
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:134:9: error: 'DIYinoSoundSerial' does not name a type
  inline DIYinoSoundSerial * getSerial() {
         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:605:2: error: 'DIYinoSoundSerial' does not name a type
  DIYinoSoundSerial * mp3Serial;
  ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In constructor 'DFPlayer::DFPlayer()':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:125:9: error: 'class DFPlayer' has no member named 'mp3Serial'
   this->mp3Serial = NULL;
         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In destructor 'DFPlayer::~DFPlayer()':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:129:15: error: 'mp3Serial' was not declared in this scope
   if (NULL != mp3Serial) {
               ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:130:17: error: 'class DFPlayer' has no member named 'mp3Serial'
    delete this->mp3Serial;
                 ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In member function 'void DFPlayer::setSerial(uint8_t, uint8_t, bool)':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:145:21: error: 'class DFPlayer' has no member named 'mp3Serial'
   if (NULL != this->mp3Serial) {
                     ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:146:17: error: 'class DFPlayer' has no member named 'mp3Serial'
    delete this->mp3Serial;
                 ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:149:9: error: 'class DFPlayer' has no member named 'mp3Serial'
   this->mp3Serial = new DIYinoSoundSerial(receivePin, transmitPin);
         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:149:25: error: expected type-specifier before 'DIYinoSoundSerial'
   this->mp3Serial = new DIYinoSoundSerial(receivePin, transmitPin);
                         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:151:9: error: 'class DFPlayer' has no member named 'mp3Serial'
   this->mp3Serial->begin(9600);
         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In member function 'uint8_t DFPlayer::updateFifoCount()':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:187:21: error: 'mp3Serial' was not declared in this scope
   this->fifoCount = mp3Serial->available();
                     ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In member function 'void DFPlayer::send()':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:263:9: error: 'class DFPlayer' has no member named 'mp3Serial'
   this->mp3Serial->write(this->sendBuffer, DFPLAYER_BUFFER_LENGTH);
         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In member function 'void DFPlayer::receive()':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:278:41: error: 'class DFPlayer' has no member named 'mp3Serial'
   while (not isNoReceiveBit() and this->mp3Serial->available()
                                         ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:279:16: error: 'class DFPlayer' has no member named 'mp3Serial'
     and (this->mp3Serial->available() % DFPLAYER_BUFFER_LENGTH == 0)
                ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:281:4: error: 'mp3Serial' was not declared in this scope
    mp3Serial->readBytesUntil(0xEF, buffPtr, DFPLAYER_BUFFER_LENGTH);
    ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:289:27: error: 'class DFPlayer' has no member named 'mp3Serial'
   this->fifoCount = this->mp3Serial->available();
                           ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h: In member function 'uint16_t DFPlayer::getCurrentTrack()':
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:362:16: error: 'class DFPlayer' has no member named 'mp3Serial'
   while (this->mp3Serial->available()
                ^
/opt/arduino-1.8.0/libraries/USaber/sound/DFPlayer.h:363:15: error: 'class DFPlayer' has no member named 'mp3Serial'
    and (this->mp3Serial->available() % DFPLAYER_BUFFER_LENGTH == 0)) {
               ^
exit status 1
Error compiling for board Arduino Leonardo.```

Have you seen this one before?  Arduino 1.8.
@JakeS0ft
Copy link
Owner

JakeS0ft commented Feb 20, 2017

I had not previously tested on anything higher than Arduino 1.6.11, however just tonight tried 1.8.1 and seems to build OK. I have not had any other build complaints and can't seem to reproduce the issue.

If you sort out what the root cause is, please check back in so it may help others.

@HotPepperDaddy
Copy link
Author

It's odd, it just doesn't seem to recognise DIYinoSoundSerial.

USaber/sound/DFPlayer.h:120:2: error: 'DIYinoSoundSerial' does not name a type
DIYinoSoundSerial * mp3Serial;

It's definitely in the include chain.

Perhaps some compiler incompatibility with some type definition? Unfortunately I'm not an expert in c/c++. gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) I'm assuming this is using gcc/g++.

I can get the library to build by commenting out "#define BUILD_DIYINOSOUNDPLAYER" but that doesn't solve the real problem.

@JakeS0ft
Copy link
Owner

JakeS0ft commented Feb 21, 2017

Yeah, it must be the include paths for your build environment. I've been depending on the Arduino IDE to set all that up when I add the library to my sketch. I never tried it under Linux, so maybe there are differences. Try modifying line 13 in sound/DFPlayer.h.

From :
#include <sound/DIYinoSoundSerial.h>
To:
#include "DIYinoSoundSerial.h"

If that works for you, I'll make the change part of the library.

@HotPepperDaddy
Copy link
Author

I tried that already... failed to include it after the change (diff error message).

@ChadMik
Copy link

ChadMik commented Sep 18, 2018

Hi there, I know i am joining this conversation late but i am having some weird issues with compiling the DFplayer test sketch and i am wondering if a solution was ever found for your problem here. I am able to compile the DIYino and the WT588D test sketches but the DFplayer which i am choosing to use is giving a 'DFPlayerSoundMap' does not name a type error.

Sorry if this is unrelated or a dumb question. I have been building sabers for a long time but am a complete noob to coding.

@JakeS0ft
Copy link
Owner

No problem, ChadMik. DFPlayerSoundPlayer is depreciated, so it is disabled from the build by default. DIYinoSoundPlayer is identical (and in fact DFPlayerSoundPlayer is essentially just a copy of DIYinoSoundPlayer at this point). DIYinoSoundPlayer is 100% compatible with the DFPlayer Mini MP3 modules, so use that and it should be smooth sailing if it's wired correctly. Good luck with your build!

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

3 participants