-extern real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[],
- rvec x[], int nca, atom_id caindex[], gmx_bool bFit);
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[],
+ rvec x[], int nca, atom_id caindex[], gmx_bool bFit);
+
+#ifdef __cplusplus
+}
+#endif