Support Board
Date/Time: Wed, 27 Nov 2024 20:40:03 +0000
Post From: extern modifier usage tip
[2023-07-10 03:46:08] |
WeroTrader - Posts: 46 |
Regards, sierrachart team I am declaring a global variable in a ".cpp" file, which I send to an ".h" file for storing with the "extern" modifier. So far everything is correct, it compiles without error. But, when trying to use the variable in another file, the compiler gives me the following error: /usr/bin/x86_64-w64-mingw32-ld: /tmp/cc0sihwH.o:BowXel_BT_Platinum_v1_Produccion_Wfunctions.cpp:(.rdata$.refptr.Array_Trend2OUT[.refptr.Array_Trend2OUT]+0x0): undefined reference to `Array_ Trend2OUT' /usr/bin/x86_64-w64-mingw32-ld: /tmp/cc0sihwH.o:BowXel_BT_Platinum_v1_Produccion_Wfunctions.cpp:(.rdata$.refptr.Array_Trend1OUT[.refptr.Array_Trend1OUT]+0x0): undefined reference to `Array_ Trend1OUT' collect2: error: ld returned 1 exit status I ask you for a little help; I'm just trying to load the value into a new variable of the same type: Array_ST_Trend[sc.Index] = Array_Trend1OUT[sc.Index]; For your attention and response, I thank you in advance. |