I have an issue when compiling. Whenever I include stdio.h or stdlib.h, and
#include <cc++/config.h>
#include <cc++/macros.h>
#include <cc++/thread.h> //<<==I think this is the culprit
#include <cc++/socket.h>
I get this error:
g++ -I../include -I/home/syw/include -Wall -c -g plc_intf.cpp -o plc_intf.o
In file included from threadedPlcServer.h:9,
from plc_intf.cpp:2:
/home/syw/include/cc++/thread.h:189: syntax error before `;'
Hey gang--
I have an issue when compiling. Whenever I include stdio.h or stdlib.h, and
#include <cc++/config.h>
#include <cc++/macros.h>
#include <cc++/thread.h> //<<==I think this is the culprit
#include <cc++/socket.h>
I get this error:
g++ -I../include -I/home/syw/include -Wall -c -g plc_intf.cpp -o plc_intf.o
In file included from threadedPlcServer.h:9,
from plc_intf.cpp:2:
/home/syw/include/cc++/thread.h:189: syntax error before `;'
and this line is:
class ThreadLock
{
private:
#ifdef HAVE_PTHREAD_RWLOCK
pthread_rwlock_t _lock; //<<==line 189
#else
pthread_mutex_t _lock;
#endif
public:
...
Obviously the thread.h is okay, and everything works if I remove the std*.h includes but this is very combersome if there are many nested includes.
Any ideas?
TIA
Never mind--
Naturally, after I posted this I found the solution in message 32936 in this forum.
The trick is to use the same configuration switches as used in include/cc++/config.def.