Yes they should be built with the same toolchain, whilst most C compiler writers bend over backwards to keep the ABI stable sometimes mismatch happens. And of course there is the `sizeof long` problem.
Aside, I am somewhat surprised that we don't have more problems with Geany being C++ and G-P being C.