To make sure that all parameters are correctly passed to the external routines, you should declare it with the correct calling convention modi er. When linking with code blocks compiled with standard C compilers (such as GCC), the cdecl modi er should be used so as to indicate that the external routine uses C type calling conventions. For more information on the supported calling conventions, section 6.3, page 319.
As might expected, external variable declarations do not require any calling convention modi er.