I\'ve made two functions to \'cast\' a 32/64 bit pointer into a double. The code worked when used alone (Just the .h and a .cpp including it) but when using the .h somewhere
Put your code in a .cpp file and in the .h file just put the prototypes -
double ptr2double(void* pv);
void* double2ptr(double dv);
Or keep the code as it is and add "inline" to each function definition which will allow you to define them in each module
Although I don't think that your code will actually do anything very useful. it's undefined behavour to access a different member of a union than the one you used to store the data. Plus even if that "worked" I can't think how you plan to use this, you'll store a double and read 32 bits of it into a pointer (on a 32 bit machine)... How can you possibly make use of this for anything?