you didn't do anything "wrong". There are a lot of porting issues you must deal with when porting C programs to C++. Most (if not all) the errors you are getting are probably because the functions have not been prototyped before used in main(). You need the *.h file that prototypes all the functions in that library.
If the program is already including the correct header files, make sure the prototypes contain the correct parameter list -- c++ is picky about that. For example, c++ initialize_fold(int) is not the same as initialize_fold()
Second issue: when you get everything to compile correct, it may not link with that C library. C++ normally "mangles" function names, while C does not. To keep c++ from doing that so that the program can be linked with C libraries you have to declare the functions as Extern "C". Here is an example -- you will find many other examples in your c++ compiler's standard include directory.
#ifdef _cplusplus // if compiled with C++ compiler. Note that this is not
// standard, check your compiler's docs and other header files to find out
// the correct macro it uses for c++ versus C compilations.
extern "C" {
#endif
//
// put C function prototypes here
int intialize_fold(int);
// other function prototypes here
#ifdef _cplusplus // if compiled with C++ compiler
} // end of extern "C" block
#endif