Hi,
I've been practising client-server shared memory and the APUE test book gives an example and won't compile.
The errors are:
undefined reference to '_TELL_WAIT'
undefined reference to '_TELL_CHILD'
undefined reference to '_WAIT_CHILD'
undefined reference to '_WAIT_PARENT'
undefined reference to '_TELL_PARENT'.
I'd guess you aren't linking in the library that defines those functions. I'm not familiar with the one you're using, though, so perhaps you should check your reference materials about it.
Please show the command line (or makefile) you've used to compile. It's likely you need to compile the file that implements those functions and link them with your file.
For example "gcc lib/tellwait.c myfile.c -o myfile.exe"
There are too many variations, but the command line you're trying to use will give an idea of how you're setup and what the closest working answer will be.
I think the library is linked okay, if you're referring to "apue.h"? This header file works on other examples so, the apue.h code is correct.
The command line I am using to compile the example is:
gcc -O2 -o sharedMemoryPage539Figure15.33.exe sharedMemoryPage 539Figure15.33.c
I have found some other online examples which run, after some code adjustments, however I expect the text book to run with less complication than the online examples I have currently ended up having to use.
More out of curiosity know to get the text book example to work.