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

NeoEsp8266UartMethod.h error swap is not a member of std #243

Closed
Wifiunterputzdose opened this Issue Jan 4, 2019 · 10 comments

Comments

Projects
None yet
4 participants
@Wifiunterputzdose
Copy link

Wifiunterputzdose commented Jan 4, 2019

Hello, I'm using the ESP8266HUEEMulator with the NeoPixelBusLib Version 2.4.1

After compiling in PlatformIO I got this compile error

In file included from C:\Users\xxx\.platformio\lib\NeoPixelBus_ID547\src\internal\NeoEsp8266UartMethod.cpp:28:0: C:\Users\xxx\.platformio\lib\NeoPixelBus_ID547\src\internal\NeoEsp8266UartMethod.h: In member function 'void NeoEsp8266AsyncUart <T_UARTFEATURE, T_UARTCONTEXT>::UpdateUart()': C:\Users\xxx\.platformio\lib\NeoPixelBus_ID547\src\internal\NeoEsp8266UartMethod.h:260:9: error: 'swap' is not a member of 'std' std::swap(_asyncPixels, _pixels); ^ *** [.pioenvs\nodemcuv2\lib97a\NeoPixelBus_ID547\internal\NeoEsp8266UartMethod.cpp.o] Error 1 [ERROR] Took 14.53 seconds

How to get rid of this error?

@Makuna

This comment has been minimized.

Copy link
Owner

Makuna commented Jan 4, 2019

Note: I do not support platform io issues, but someone else may jump in here.

Include enough code to give some sort of context please.

Are you using NeoEsp8266Uart1Method or NeoEsp8266Uart0Method?

@T3rorx

This comment has been minimized.

Copy link

T3rorx commented Jan 5, 2019

I have the same issue, you not talking about NeoEsp8266 Method in your tutorial

http://sarakha63-domotique.fr/nodemcu-teleinformation-wifi/#prettyPhoto

@Makuna

This comment has been minimized.

Copy link
Owner

Makuna commented Jan 5, 2019

Try changing the line

NeoPixelBus<NeoGrbFeature, NeoEsp8266Uart800KbpsMethod> 

to

NeoPixelBus<NeoGrbFeature, NeoEsp8266Uart1Ws2812xMethod> 
@Wifiunterputzdose

This comment has been minimized.

Copy link
Author

Wifiunterputzdose commented Jan 6, 2019

Hi Michael thanks for your help.

with an older version 2.3.3 I get rid of this error.

I will give a try with the new version and your suggestion

@ScS123

This comment has been minimized.

Copy link

ScS123 commented Jan 7, 2019

Platform
Hardware: PC

Development Env: Arduino IDE (v1.8.8)
Operating System: Windows 10
Settings in IDE
Module: NodeMCU 1.0 ESP8266 12E

CPU Frequency: 80Mhz
FLASH size 4M (1MSPIFFS)

I have long used:
NeoPixelBus<NeoGrbFeature, NeoEsp8266Dma800KbpsMethod> strip(PixelCount, PixelPin);
for my esp8266 12E builds through NeoPixelBus 2.3.5. It has always given me solid service.

As of version 2.4.1 I also get the following compile error:
In file included from C:\Arduino\libraries\NeoPixelBus_by_Makuna\src\internal\NeoEsp8266UartMethod.cpp:28:0:

C:\Arduino\libraries\NeoPixelBus_by_Makuna\src\internal\NeoEsp8266UartMethod.h: In member function 'void NeoEsp8266AsyncUart<T_UARTFEATURE, T_UARTCONTEXT>::UpdateUart()':

C:\Arduino\libraries\NeoPixelBus_by_Makuna\src\internal\NeoEsp8266UartMethod.h:260:9: error: 'swap' is not a member of 'std'

     std::swap(_asyncPixels, _pixels);

Using "NeoPixelBus<NeoGrbFeature, NeoEsp8266Uart1Ws2812xMethod> " also gives me the same error.

@ScS123

This comment has been minimized.

Copy link

ScS123 commented Jan 7, 2019

In all fairness, I looked at my other build. Running Arduino IDE 1.8.7 with Makuna NeoPixelBus 2.4.1 compiling SAME code just fine. Installed depricated Arduino IDE 1.8.7 on my first machine and still have same issues with NeoPixelBus 2.4.0 and above. Obviously missing some library somewhere....

@Makuna

This comment has been minimized.

Copy link
Owner

Makuna commented Jan 7, 2019

std::swap is part of the stl files; which gets included with the Esp8266 board support. In Arduino.h on the line #include <algorithm> should bring it in.

What version of the esp8266 board support are you using (look in the board manager).
I am using:
Arduino IDE 1.8.5
Board Support 2.5.0.rc2
NeoPixelBus version shouldn't matter on this single line, as swap has been present in the code for several years.

I will try the latest Arduino IDE and see if I can repro with it.
Its an evironment config issue then.

@Makuna

This comment has been minimized.

Copy link
Owner

Makuna commented Jan 7, 2019

Ok, I can't reproduce this all with Arduino IDE 1.8.8 (latest)
There is more than likely a configuration issue on your side with your IDE environment.
I would recommend you close the IDE, then clear your temp files (C:\Users\user name\AppData\Local\Temp\arduino_build_*) and then start the IDE.
Either use esp8266 board support 2.4.2 (latest release) or newer

@ScS123

This comment has been minimized.

Copy link

ScS123 commented Jan 7, 2019

After much searching, the problem stemmed from using a "staging" version of the ESP8266 board definition. After changing to the "stable" version and recompiling, there were no issues with 2.4.1

@Makuna

This comment has been minimized.

Copy link
Owner

Makuna commented Jan 11, 2019

@Wifiunterputzdose Did you see ScS123 solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.