Closed No3x closed 2 years ago
Hi @No3x,
I'm guessing strstr
is not part of the std
in mingw-w64: gcc-7.1.0
It might be missing a #include <cstring>
here ArduinoFake.
Can you give that a try ?
I already tried this lines in all variants:
#include <iostream>
#include <cstring>
using namespace std;
without any success.
EDIT: gosh.. I have edited the
ArduinoFake\src
instead of the
ArduinoFake\examples\wiring-blink\.piolibdeps\ArduinoFake_ID1689\src
all the time..
Now the tests compiling and passing. Sorry! What compiler do you use?
It might not be using the same version.. What do you get when running the tests in the root directory ?
cd path-to/ArduinoFake
pio test
pio test in the root fails like before. But with
#include <iostream>
#include <cstring>
added it does not.
Cool..
Can you send a PR ?
Of course
pio test
==================== [test::*] Building... (1/2) ======================
Please wait...
C:/Program Files (x86)/mingw-w64/i686-7.1.0-posix-dwarf-rt_v5-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.1.0/../../../../i686-w64-mingw32/bin/as.exe: .pioenvs\native\test\main.o: too many sections (36801)
C:\Users\user\AppData\Local\Temp\ccobVkGB.s: Assembler messages:
C:\Users\user\AppData\Local\Temp\ccobVkGB.s: Fatal error: can't write 117 bytes to section .text of .pioenvs\native\test\main.o because: 'File too big'
C:/Program Files (x86)/mingw-w64/i686-7.1.0-posix-dwarf-rt_v5-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.1.0/../../../../i686-w64-mingw32/bin/as.exe: .pioenvs\native\test\main.o: too many sections (36801)
C:\Users\user\AppData\Local\Temp\ccobVkGB.s: Fatal error: can't close .pioenvs\native\test\main.o: File too big
*** [.pioenvs\native\test\main.o] Error 1
Could fix this by setting build flags to build_flags = -std=gnu++11 -O3 -Wa,-mbig-obj
https://stackoverflow.com/questions/16596876/object-file-has-too-many-sections
http://discourse.chaiscript.com/t/compiled-in-std-lib-with-mingw/66
https://forum.qt.io/topic/59978/error-file-too-big/6
I really hate this C++ compiler jungle.
Please let me know if I should add these flags too.
Hello, i have added #include <cstring>
and it works finally.
@Sparow199 thanks for confirming this. There is still a pending PR that should fix this. I guess you don't compile on Windows/MinGW - because this introduces a new issue described in my last comment.
I want to play around with your testing framework but can't compile the example
wiring-blink
. I get this error for each occurence ofstd::strstr
:I'm on windows with mingw-w64: gcc-7.1.0 platform information: https://pastebin.com/ZCCbF3E9
I did not find any information on this. Maybe you know the reason?