C++/reading reference table
How are you? I have a program that needs to read in a reference table during runtime. The program would refer to this table from time to time. The table is basically two 1-dimensional arrays of doubles. Currently I do it by referring to a function which is nothing more than the statements for arrays:
I do this because I don't know how to make a text file part of the compiled application (static). Anyway, my method should work, but I run into weird problems. For example it compiles on 32 Debian to give a 1 MB executable which runs fine. When I compile the same program on 64 bit Scientific Linux (RedHat) it takes a long time to compile and the executable is 70 MB and it won't run (I get a weird message that an X-something is not found). I'm using Qt. I'm pretty sure that my functions that contain all the array definitions cause this. Do you know what is happening? I'm very thankful for any ideas.
Well, one reason I could suggest is perhaps your environments are incompatible! while one assumes the integer size or pointer size to be 32bit, the other doesn't. Your Debian might be relying on undefined behaviour. There could be other reasons. My advise: Try to read up some blogs about this. This is mainly a research you should find out. sometimes, your programming environment(in this case Debian) have assumed that pointers can be stored in 32 bit structures but tends not to work when the same programme now runs on RedHat which might be 64 bit.