cancel
Showing results for 
Search instead for 
Did you mean: 

Dear friend: I've been working with the STM32CubeIDE V1.8.0 ( I've continued working with this version because I found some problems and, with your help it worked well) . I downloaded this week the v. 1.12.1 and I had a problem: In the older version, I

INaka.1
Associate III

define the global variables inside a variables.h file, and was possible to use within several procedures (*.c) only informing with #define "variables.h". In this version it isn't possible.

How can I declare the global variables ?

Thank you for your attention,

Best regards, Ilson

1 ACCEPTED SOLUTION

Accepted Solutions

Use extern definitions in the include file and define them ONCE in a SINGULAR .C file​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4
JTP1
Lead

Hello. I think the change in GCC 10 to put -fno-common as default is causing your problems. CubeIDE 1.9.0 was first to use GCC 10 as default toolchain.

Try to add -fcommon flag to C/C++ miscellanous options.


_legacyfs_online_stmicro_images_0693W00000bl3yaQAA.pnghttps://gcc.gnu.org/gcc-10/porting_to.html

Use extern definitions in the include file and define them ONCE in a SINGULAR .C file​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you for your fast response.

Thank you for you attention. I'll see this suggestion.