Home        Store        Docs        Blog

"Error stray '\#' in program" when compiling MS5837 example code in Arduino Mega


(Justin Moore) #1
Arduino: 1.8.5 (Linux), Board: "Arduino Mega ADK"

/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\5' in program
                             2  �     �            �  ��v��v�"R�"R    ATTR;���  �   �   :                  �   :  com.apple.quarantine 0081;5b3b7f21;Firefox;6D1C1E39-9FD3-410A-93A7-EAA0F849FD97                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             This resource fork intentionally left blank                                                                                                                                                                                                                            ���                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             a   Mac OS X                2  �     �                                    ATTR;���  �   �   :                  �   :  com.apple.quarantine 0081;5b3b7f21;Firefox;6D1C1E39-9FD3-410A-93A7-EAA0F849FD97                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             This resource fork intentionally left blank                                                                                                                                                                                                                            ��
  ^
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\26' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\7' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\2' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\2' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\16' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\260' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\2' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\16' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\342' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\1' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\36' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\232' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\311' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\377' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\16' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\342' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\230' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\1' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\230' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\25' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:153: error: invalid digit "8" in octal constant
  a   Mac OS X                2  �     �                                    ATTR;���  �   �   :                  �   :  com.apple.quarantine 0081;5b3b7f21;Firefox;6D1C1E39-9FD3-410A-93A7-EAA0F849FD97                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             This resource fork intentionally left blank                                                                                                                                                                                                                            ��
                                                                                                                                                     ^
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\1' in program
  a   Mac OS X                2  �     �                                    ATTR;���  �   �   :                  �   :  com.apple.quarantine 0081;5b3b7f21;Firefox;6D1C1E39-9FD3-410A-93A7-EAA0F849FD97                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             This resource fork intentionally left blank                                                                                                                                                                                                                            ��
  ^
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\1' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\36' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\1' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\1' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\36' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\34' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\36' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\377' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:2: error: stray '\377' in program
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:9: error: 'Mac' does not name a type
  a   Mac OS X                2  �     �                                    ATTR;���  �   �   :                  �   :  com.apple.quarantine 0081;5b3b7f21;Firefox;6D1C1E39-9FD3-410A-93A7-EAA0F849FD97                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             This resource fork intentionally left blank                                                                                                                                                                                                                            ��
     ^
/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:104: error: expected unqualified-id before ':' token
 
                                                                                                                                                          ^
                                                                                                                                                                           ^
exit status 1
Error compiling for board Arduino Mega ADK.

In my Arduino IDE, I just imported the MS5836_Example and compiled it. The pressure sensor itself should be wired up correctly, but that could always be the issue as well. It could also be some weird character encoding issue? I included some photos below of our setup. Thanks for your help! :grinning:


(Patrick José Pereira) #2

Hi Justin,

You should compile the library just fine.
The ._MS5837.cpp does not exist in our repository, please do a fresh install of the library.
Like: cd ~/Arduino/libraries/ && git clone https://github.com/bluerobotics/BlueRobotics_MS5837_Library after removing the old folder.

From your log:

/home/pi/Arduino/libraries/BlueRobotics_Pressure/._MS5837.cpp:1:9: error: 'Mac' does not name a type
  a   Mac OS X                2  �     �    

Where did you get this library folder ? It appears to be from a macbook.


(Justin Moore) #3

I am not sure what happened, but following your steps seemed to fix everything for us.
Thank you so much!