I am writing this code to read 3 files, TM - the size of the square matrix, LER - the number of rows in the array, and from the last value - the non-square matrix (ler / 2) * 2
Then ... the code reads the file with some relationships, all are numbers and are assigned to C [ler].
Then ... C [ler] is assigned to B [ler / 2] [2].
These coordinates for each line in B [ler / 2] [2] are assigned a and b.
a and b are the row and column of the matrix A [tm] [tm], where to add 1.
My code crashes and I don't see what the error is.
When I try to compile it, the gcc -g -o MatSim compiler MatSim.cpp compiler requested:
/usr/include/c++/4.6/iostream:75: undefined reference to `std::ios_base::Init::Init()' /usr/include/c++/4.6/iostream:75: undefined reference to `std::ios_base::Init::~Init()' collect2: ld returned 1 exit status
Also, when I try to compile it, the f77 -o MatSim compiler MatSim.cpp compiler requested:
/tmp/cc6ewlkf.o: In function `__static_initialization_and_destruction_0(int, int)': MatSim.cpp:(.text+0x17ad4a): undefined reference to `std::ios_base::Init::Init()' MatSim.cpp:(.text+0x17ad4f): undefined reference to `std::ios_base::Init::~Init()' collect2: ld returned 1 exit status
Decision
The main problem was the problem with the library. Compile your code using:
g++ -g -o MatSim MatSim.cpp -lstdc
Still not working? Libraries Installation:
sudo apt-get install g++-multilib
c matrix coredump
Another.Chemist Jun 05 '12 at 23:15 2012-06-05 23:15
source share