I am trying to use C++ programs through MathLink in my notebooks, but I cannot compile successfully the simple programs included in Mathematica.
I do not have a specific question, I am just looking for guidance.
"9.0 for Linux x86 (64-bit) (November 20, 2012)"
My operating system is Linux Mint 17.3 Cinnamon 64-bit.
Step by step, what I am trying to do is the following:
mcc -o addtwo ../MathLinkExamples/addtwo.c ../MathLinkExamples/addtwo.tm
Since I am trying to compile from the directory where the libraries and header (mathlink.h) is, I think it should work (I am no C expert either). I've also tried copying the addtwo.c and addtwo.tm files in the "CompilerAdditions" folder and run everything from there with the same results. I get the following errors
$InstallationDirectory/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/libML64i3.so: undefined reference to 'shm_open'
(*more undefined references, see below*)
collect2: error: ld returned 1 exit status
Undefined references to: 'sem_init', 'sem_unlink', 'sem_close', 'pthread_sigmask', 'sem_destroy', 'shm_unlink', 'pthread_create', 'sem_post', 'sem_trywait', 'sem_open', 'sem_wait', and 'pthread_join'. It seems related to semaphore, but I am really clueless here.