xoseperez / sonoffsc

Itead Studio SonoffSC custom firmware with MQTT and Domoticz support
GNU General Public License v3.0
104 stars 35 forks source link

Compiling Problems under Windows #42

Open daveschafer opened 5 years ago

daveschafer commented 5 years ago

Ok, so this is not really an issue with your code (worked like a charm after I figured out the problem). It's more a help for other people having the same issue.

Under Windows 10 I've got a lot of issues while compiling the code. No problems with Ubuntu though. Most of the Problems had to do something with the Time.h/time.h library like

error: 'strcpy_P' was not declared in this scope error: 'strftime' was not declared in this scope

I found the solution here: Example doesn't compile because Time.h

Apparently, Windows is sometimes not case sensitive and mixes up different time.h/Time.h libraries. To fix these compiling errors:

  1. Rename the lib:
  1. Find all occurrences of WebHandlerImpl.h in your Windows. Replace #include <time.h> with #include <_time.h>
    • There's also one occurence in libc_replacements.c which you've got to replace
  2. Build your project. (Recommended restart platformio before the build).
  3. Remember that you've changed this library or rename it back after compiling this project

Issues was already mentioned once here: #34

Hope this will help someone in the future