Please help me
Error details as follows:
src/a.cpp:2972: undefined reference to `B::XTT collect2: ld returned 1 exit status
B::XTT
is a static constant variable in the B
struct.
2969 if (index != B::XTT) {
2970 index_map_iter = lookup_index.find(merchandising_index);
2971 merchandising_index = index_map_iter != output_index.end() ? \
2972 index_map_iter->second : B::XTT;
It is very strange that the first time I use B::XTT
on line 2969, it does not produce an error. But at 2972 I use B::XTT
, and it produces an error.
And if I add -O2
option when I use g++
command, it does not produce an error.
But it does produce an error without -O2
.