https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92951
Bug ID: 92951
Summary: extern variable declaration doesn't behave properly
for me
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fportera2 at gmail dot com
Target Milestone: ---
I have a global variable 'traindata' declared in cnn.cpp:
arma::mat traindata;
, I'm importing this varible in mean_squared_error.hpp:
#include <mlpack/core.hpp>
extern arma::mat traindata;
and I'm trying to exploit this variable in mean_squared_error_impl.hpp (that
includes 'mean_squared_error.hpp'), for example:
printf("n_rows = %d, n_cols = %d\n", traindata.n_rows, traindata.n_cols);
but it gives me that the dimensions are 0's (while in the cnn.cpp' main() they
are positive).
thanks