I have no problem in compiling your code, I'm using codeblocks with mingw - windows xp. Just a suggestion you must use %lf for the conversion specifier of double.