cancel
Showing results for 
Search instead for 
Did you mean: 

How to add new flag to build a extra library

A..1
Associate II

Hello

I am a beginner. I am trying to build my project using the minmea library but I got a "timegm" warning.

In the library page says <Some systems lack timegm. On these systems, the recommended course of action is to build with -Dtimegm=mktime which will work correctly as long the system runs in the default UTC timezone.>. I added the -Dtimegm=mktime in this places in my project setting

MCU GCC Compiler >> Miscellaneous >> Add other flags

MCU GCC Linker >> Miscellaneous >> Add other flags

but still I have the messages or warining

How to solve it. I am using STM32CubeIDE 1.4

../Drivers/minmea/Src/minmea.c: In function 'minmea_gettime':
../Drivers/minmea/Src/minmea.c:635:24: warning: implicit declaration of function 'timegm'; did you mean 'time'? [-Wimplicit-function-declaration]
     time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */
                        ^~~~~~
                        time
 
 
12:02:11 Build Finished. 0 errors, 1 warnings. (took 9s.351ms)

1 ACCEPTED SOLUTION

Accepted Solutions
Markus GIRDLAND
ST Employee

Hello!

I did some testing on my side. Looks like something might be wrong with the miscellaneous menu option.

If you add timegm=mktime to the preprocessor (MCU GCC Compiler -> Preprocessor) then it works for me. However, adding -D and using the same argument in Miscellaneous doesn't seem to work.

That does seem like a bug. However, I tested it with our internal weekly build and it's fixed there so it will be fixed in the next release.

View solution in original post

2 REPLIES 2
Markus GIRDLAND
ST Employee

Hello!

I did some testing on my side. Looks like something might be wrong with the miscellaneous menu option.

If you add timegm=mktime to the preprocessor (MCU GCC Compiler -> Preprocessor) then it works for me. However, adding -D and using the same argument in Miscellaneous doesn't seem to work.

That does seem like a bug. However, I tested it with our internal weekly build and it's fixed there so it will be fixed in the next release.

A..1
Associate II

Thanks so much.

I don't know why, but it is true... Now I have 0 errors 0 warnings