Topic: arduino problem:collect2.exe: error: ld returned 1 exit status

Hello,
I am currently working on using wolfssl on ESP8266(a convenient wifi module) to create https linking via arduino for esp8266,but when I programmed your example for arduino,I met the problem as follows:

C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\asn.c.o: In function `CheckCurve':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/asn.c:3473: undefined reference to `__ctype_ptr__'
C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\asn.c.o: In function `ExtractDate':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/asn.c:3473: undefined reference to `gmtime'
C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\asn.c.o: In function `ValidateDate':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/asn.c:3473: undefined reference to `gmtime'
C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\random.c.o: In function `wc_RNG_HealthTestLocal':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/random.c:556: undefined reference to `random'
C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\random.c.o: In function `wc_GenerateSeed':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/random.c:556: undefined reference to `random'
collect2.exe: error: ld returned 1 exit status

I don't know actually how to correct that and hope you can give me some advice.
I am using arduino 1.6.5 .My system is Windows 7

Share

Re: arduino problem:collect2.exe: error: ld returned 1 exit status

Hi gavinfred,

We have not ported to the esp8266 yet. Have you had a chance to review our porting guide when building for a new platform?

https://wolfssl.com/wolfSSL/Docs-wolfss … guide.html

That will address all the issues you just noted:

C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\asn.c.o: In function `CheckCurve':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/asn.c:3473: undefined reference to `__ctype_ptr__'

It looks like you may need to include libc with the flag `-libc`
If you already have libc then try re-installing your toolchain.

.

C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\asn.c.o: In function `ExtractDate':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/asn.c:3473: undefined reference to `gmtime'
C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\asn.c.o: In function `ValidateDate':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/asn.c:3473: undefined reference to `gmtime'

See section:

2.9  Time
Necessary when standard time functions are not available, or you need to define a custom clock tick function.

.

C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\random.c.o: In function `wc_RNG_HealthTestLocal':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/random.c:556: undefined reference to `random'
C:\Users\gavin\AppData\Local\Temp\build1361818746455674135.tmp\wolfssl-master\random.c.o: In function `wc_GenerateSeed':
D:\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\wolfssl-master/random.c:556: undefined reference to `random'
collect2.exe: error: ld returned 1 exit status

See section:

2.7  Random Seed
Necessary if either /dev/random or /dev/urandom is not available or you want to integrate into a hardware RNG.


Best Regards,

Kaleb

Re: arduino problem:collect2.exe: error: ld returned 1 exit status

Hi gavinfred,

One other note, we have a define for WOLFSSL_ARDUINO in <wolfssl-root>/wolfssl/wolfcrypt/settings.h that may be helpful if you hadn't seen that yet and also an issue here that might be helpful as well.

https://github.com/wolfSSL/wolfssl/issues/539


Regards,

Kaleb

4 (edited by gavinfred 2016-12-23 03:47:12)

Re: arduino problem:collect2.exe: error: ld returned 1 exit status

Hi Kaleb:
I am writing programs for esp8266 using arduino platform,which is a program on github.I have uncommented the arduino options in settings.h.But I think the wolfssl doesn't quite rely on hardware but I am not quite sure about that . I am reading your manual recently and hoping I can do a bit of job this winter. I will check your advice and thank you for your help.

Regards,

Gavin

Share