relativty / Relativty

An open source VR headset with SteamVR supports for $200
https://www.relativty.com/
GNU General Public License v3.0
6.65k stars 347 forks source link

"min was not declared in this scope" #49

Open lamnoda opened 4 years ago

lamnoda commented 4 years ago

In Arduino IDE, when trying to compile the code, and error message, "min was not declared in this scope" pops up. Any Solution?

The Full Error Messages:

Arduino: 1.8.10 (Windows 10), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)"

sketch\I2Cdev_PillPatch.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':

I2Cdev_PillPatch.cpp:276:50: error: 'min' was not declared in this scope

         for (uint8_t k = 0; k < length; k += min<int>(length, BUFFER_LENGTH)) {

                                              ^

I2Cdev_PillPatch.cpp:276:54: error: expected primary-expression before 'int'

         for (uint8_t k = 0; k < length; k += min<int>(length, BUFFER_LENGTH)) {

                                                  ^

I2Cdev_PillPatch.cpp:276:54: error: expected ')' before 'int'

I2Cdev_PillPatch.cpp:276:57: error: expected unqualified-id before '>' token

         for (uint8_t k = 0; k < length; k += min<int>(length, BUFFER_LENGTH)) {

                                                     ^

I2Cdev_PillPatch.cpp:693:59: error: expected '}' at end of input

uint16_t I2Cdev::readTimeout = I2CDEV_DEFAULT_READ_TIMEOUT;

                                                       ^

C:\Users\dogsp\Desktop\Relativ-master\STM32\STM32_BlackPill\STM32_BlackPill.ino: In function 'void setup()':

STM32_BlackPill:48:14: error: 'class TwoWire' has no member named 'setSDA'

     Wire.setSDA(PB7);

          ^

STM32_BlackPill:49:14: error: 'class TwoWire' has no member named 'setSCL'

     Wire.setSCL(PB6);

          ^

Multiple libraries were found for "Wire.h" Used: C:\Users\dogsp\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2019.12.31\libraries\Wire Not used: C:\Users\dogsp\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2019.12.31\libraries\WireSlave exit status 1 'min' was not declared in this scope

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

fa1ke5 commented 4 years ago

You need selecting proper sdk and board in arduino, read wiki