Why when I wan to compile the following multi thread merge sorting C program, I receive this error:
ap@sharifvm:~/forTHE04a$ gcc -g -Wall -o mer mer.c -lpth
Neither nor are standard C header files. Your code is meant to be C++, where is a valid header. Use g++ (and a .cpp file extension) for C++ code.
Alternatively, this program uses mostly constructs that are available in C anyway. It's easy enough to convert the entire program to compile using a C compiler. Simply remove #include and using namespace std;, and replace cout << endl; with putchar('\n');... I advise compiling using C99 (eg. gcc -std=c99)