-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Undefined reference to __cxa_guard_acquire and __cxa_guard_release #356
Comments
It turns out this happens because I'm using https://github.com/sudar/Arduino-Makefile to compile the project. When I use the IDE, it works fine. |
I would be very interested to know if you find a proper workaround so that I could add it to Compatibility Issues. |
I figured out the problem. I had the following in my Makefile:
Removing this fixed the problem. |
I don't like this because it mean you won't be able to use C++11 features in your code. Can you try to add this flag instead:
|
Apparently Arduino defaults to |
CXXFLAGS_STD += -std=gnu++11 ; Could you pl give steps where precisely this correction to be made. Im finding very hard to make out. |
Hello Satish, If you use the Arduino IDE, you need to edit the
I edited the FAQ, so that it'll be easier to find. Please confirm this solves your problem. Regards, |
Thanks Benoit , for the speedy reply. Will try out and get back to you at
once.
regards
satish
…On Mon, Mar 13, 2017 at 2:52 PM, Benoît Blanchon ***@***.***> wrote:
Hello Satish,
If you use the Arduino IDE, you need to edit the platform.txt of the
board you're using:
- The file is located at %LOCALAPPDATA%\Arduino15\
packages\<brand>\hardware\<board>\<version>\platform.txt
- The line to change is compiler.cpp.flags
I edited the FAQ
<https://arduinojson.org/faq/compilation-fails-device-crashes-nothing-on-serial-console/#error-undefined-reference-to-cxaguardacquire-and-cxaguardrelease>,
so that it'll be easier to find.
Please confirm this solves your problem.
Regards,
Benoit
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#356 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZJzBdmPuYuoSECyWiCA0Usbu4uh-yxmks5rlQq7gaJpZM4KBqvb>
.
|
Hi Benoit
Located the path for platform.txt for esp8266 module found the following
lines .
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals
-fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD
-ffunction-sections -fdata-sections
Found the line as
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals
-fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD
-ffunction-sections -fdata-sections
Removed the line: -std=c++11
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals
-fno-exceptions -fno-rtti -falign-functions=4 -MMD -ffunction-sections
-fdata-sections
Saved the file and opend Arduino 1.6.4 version IDE
From examples ArduinoJson took the file JsonParserExample.ino file and
recompiled ... This gave me the following error
Arduino: 1.6.4 (Windows 8.1), Board: "Generic ESP8266 Module, Serial, 80
MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS), ck"
In file included from
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/Arduino.h:247:0,
from JsonParserExample.ino:10:
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/HardwareSerial.h:85:27:
warning: override controls (override/final) only available with -std=c++11
or -std=gnu++11 [enabled by default]
int available(void) override;
^
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/HardwareSerial.h:86:22:
warning: override controls (override/final) only available with -std=c++11
or -std=gnu++11 [enabled by default]
int peek(void) override;
^
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/HardwareSerial.h:87:22:
warning: override controls (override/final) only available with -std=c++11
or -std=gnu++11 [enabled by default]
int read(void) override;
^
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/HardwareSerial.h:89:24:
warning: override controls (override/final) only available with -std=c++11
or -std=gnu++11 [enabled by default]
void flush(void) override;
^
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/HardwareSerial.h:90:29:
warning: override controls (override/final) only available with -std=c++11
or -std=gnu++11 [enabled by default]
size_t write(uint8_t) override;
^
In file included from JsonParserExample.ino:10:0:
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/Arduino.h:275:48:
error: 'nullptr' was not declared in this scope
const char* server1, const char* server2 = nullptr, const char*
server3 = nullptr);
^
C:\Users\Satish\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/Arduino.h:275:79:
error: 'nullptr' was not declared in this scope
const char* server1, const char* server2 = nullptr, const char*
server3 = nullptr);
^
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Have spent more then a day to sort the problum still getting same error .
Appreciate your help to solve the issue.
regards
satish
On Mon, Mar 13, 2017 at 3:10 PM, satish kumar <satishmoorthy94@gmail.com>
wrote:
… Thanks Benoit , for the speedy reply. Will try out and get back to you at
once.
regards
satish
On Mon, Mar 13, 2017 at 2:52 PM, Benoît Blanchon ***@***.***
> wrote:
> Hello Satish,
>
> If you use the Arduino IDE, you need to edit the platform.txt of the
> board you're using:
>
> - The file is located at %LOCALAPPDATA%\Arduino15\packa
> ges\<brand>\hardware\<board>\<version>\platform.txt
> - The line to change is compiler.cpp.flags
>
> I edited the FAQ
> <https://arduinojson.org/faq/compilation-fails-device-crashes-nothing-on-serial-console/#error-undefined-reference-to-cxaguardacquire-and-cxaguardrelease>,
> so that it'll be easier to find.
>
> Please confirm this solves your problem.
>
> Regards,
> Benoit
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#356 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AZJzBdmPuYuoSECyWiCA0Usbu4uh-yxmks5rlQq7gaJpZM4KBqvb>
> .
>
|
Satish, you should add Explanation:
|
Aaha finally done compiling :) . Thank you very much had understood totally
wrong .
…On Mon, Mar 13, 2017 at 4:18 PM, Benoît Blanchon ***@***.***> wrote:
Satish, you should add -fno-threadsafe-statics and keep -std=c++11.
Explanation:
1. -std=c++11 enables support for the new language features introduced
in the C++11 standard, like nullptr
2. -fno-threadsafe-statics disables the mutex around initialization of
local static variables, which is useless when you program is single
threaded.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#356 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AZJzBY8sCvD7n3XOjVPSx-Zp80i1xIY9ks5rlR8RgaJpZM4KBqvb>
.
|
Just to clarify the cause (for me). I was appending |
When I compile the
JsonParserExample
I get the following error:I remember a similar problem with the Ethernet library a while back and found the issue for it (esp8266/Arduino#574). Perhaps that can help.
The text was updated successfully, but these errors were encountered: