Jump to content
JRDavisUF

strptime not declared

Recommended Posts

I'm using Rei Vilo's RTC Library: https://github.com/rei-vilo/DateTime_Library

Under Code Composer 7.4 / Energia 18 / MSP432 Red Board 4.9.1  this library compiles works fine.

When I switched to Code Composer 8.0 / Energia 18 / MSP432 Red Board 5.6.1, "strptime" seems to have disappeared.  Anyone have any ideas on what happened?

Libraries/RTC/subdir_rules.mk:9: recipe for target 'Libraries/RTC/RTC_Library.o' failed
../Libraries/RTC/RTC_Library.cpp: In function 'uint8_t convertString2DateTime(String, String, tm&)':
../Libraries/RTC/RTC_Library.cpp:88:59: error: 'strptime' was not declared in this scope
     if (strptime(charDateTime, charFormat, &_timeStructure) == NULL)
                                                           ^
thx.

jrd

Share this post


Link to post
Share on other sites

Does this Sketch compile in Energia 18? It could be a compiler issue as it is part of libc. CCS uses a later version of the GCC compiler that might need the flag -D_POSIX_SOURCE to pull in those functions. You can try editing platform.txt and add the flag like so:

compiler.c.extra_flags={compiler.emt.c.flags} {compiler.driverlib.c.flags}
becomes
compiler.c.extra_flags=-D_POSIX_SOURCE {compiler.emt.c.flags} {compiler.driverlib.c.flags}

Platform.txt is in:

On GNU/Linux: ~/.energia15/packages/energia/hardware/msp432r/5.6.1/
On Windows: %LOCALAPPDATA%\Energia15\packages\energia\hardware\msp432r\5.6.1\
On MacOS: ~/Library/Energia15/packages/energia/hardware/msp432r/5.6.1/

 

Share this post


Link to post
Share on other sites

I tried editing the platform.txt file, but it didn't seem to do anything....that is, I could never see the -D.. appearing anywhere during the compilation process.  I did try changing my compiler settings to directly include the -D... so that I could see where it was being used, but it didn't seem to make any difference and the error I mentioned still showed up.

I did realize that the routine that uses strptime isn't used by my code, so I commented it out that whole routine and my stuff works fine...so at least for now, I can punt on this issue...thanks for trying though...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...