I can compile my program with Dev-C++ and run it all day long on my laptop (Windows XP). The problem with this is my laptop is slow. So, I tried to compile the code with gcc on my Linux box. gcc, however, doesn't seem to like my code.
The error I get says: "In function `__static_initialization_and_destruction_0(int, int':." Then errors go on for another page or two. I've included the code that makes the array (if I need to include more code, I'll be more than happy).
I know about enough C++ to get done what I need, and am a new Linux user.
Thanks in advance for your help.
Expand|Select|Wrap|Line Numbers
- #include<fstream>
- #include<iostream>
- #include<math.h>
- #include<string>
- using namespace std;
- // Voxel information array
- float ***xyz = NULL;
- int main()
- {
- // Ask user for input file
- string filename;
- cout << "File, array size (*.* DIM DIM DIM): ";
- int numOfVoxelsX;
- int numOfVoxelsY;
- int numOfVoxelsZ;
- cin >> filename >> numOfVoxelsX >> numOfVoxelsY >> numOfVoxelsZ;
- string outputFileName;
- cout << endl;
- cout << "Output File Name (*.*): ";
- cin >> outputFileName;
- cout << "Initializing" << endl;
- xyz = new float**[numOfVoxelsX];
- for (i = 0; i<numOfVoxelsX; i++)
- {
- xyz[i] = new float*[numOfVoxelsY];
- for (j = 0; j<numOfVoxelsY; j++)
- {
- xyz[i][j] = new float[numOfVoxelsZ];
- }
- }
- cout << "Space allocated." << endl;
- .....