Hmm, it seems like it should work. It almost looks like the C/C++ and Altera libraries are having issues. When you say: "I have tested my aocx with another program that can load it (in a very similar way) and it works properly," is the other program using the same board with the SoC and are the host codes compiled on the ARM SoC?
I've heard of a similar issue a while back where programming the board seemed to fail on the SoCs and I think the way they got around it was by flashing the FPGA with the aocx file you intend to run and then running the host code. I'm not sure of those details. What board and chip are you using?