Problems betwen 64-bit and 32-bit builds

I have a project which I just recently included 64-bit support for, as I was using a 64-bit 3rd party library. The code builds and works as expected. On another computer, I downloaded 32-bit versions of the 3rd party library, and built a 32-bit executable of the same project. The program behaves in strange and erratic ways, and I can't figure it out. I've looked over my code many times, and everything looks just fine.

Is there any way this is possible, besides a flaw in the 32-bit compiled 3rd party library?

EDIT: When running the built 32-bit binary on the 64-bit machine, the same strange behavior occurs, so it's nothing to do with the actual machine. It's a problem on the software side.
Last edited on
The typical problems are related to typecasting and false assumptions about the sizes of data types.

Specifically, a lot of programmers assume that all pointers are the same size as ints, and this is
not true.

Have you searched for things of this nature?
Problem solved. I had a char array of sixteen elements declared like so:

char itoa16[] = "0123456789abcdef";

For some reason, this worked fine when compiled for a 64-bit target. I changed it to a char pointer:

char* itoa16 = "0123456789abcdef";

And everything works great.


Thanks for the suggestions.
Topic archived. No new replies allowed.