ZitatHast Du diesen Vorschlag (#include <ctime>) ausprobiert?
Habe gerade für x86_64 unter Opensuse leap 15.5 gebaut. Lief einwandfrei durch.
Habe ich mal eingetragen, nun klemmt es an anderer Stelle. Ich verstehe da leider nur Bahnhof.
Code
g++ -c -ggdb -O0 -pthread -fPIC -std=c++17 -Wall -Wreturn-type -Wformat -pedantic -Wunused-variable -Wunused-label -Wunused-value -Wunused-function -Wno-long-long -Wno-unused-parameter -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -Wno-psabi -I/usr/include/mariadb -I/usr/include/mariadb/mysql -D_GNU_SOURCE -DTARGET='"p4d"' -DCLASS='P4d' -DNAME='"p4"' -DLOG_PREFIX='""' -DUSEUUID -DUSEMD5 -DUSELIBARCHIVE -DUSEJSON -DUSEGUNZIP -DUSEDB -DBIN_PATH='"/usr/local/bin"' -D_NO_RASPBERRY_PI_ -DGIT_REV='"4ba6564"' -o lib/thread.o lib/thread.c
lib/thread.c: In constructor ‘cThread::cThread(const char*, bool)’:
lib/thread.c:66:3: error: ‘pthread_attr_init’ was not declared in this scope; did you mean ‘pthread_attr_t’? 66 | pthread_attr_init(&attr); | ^~~~~~~~~~~~~~~~~ | pthread_attr_t
lib/thread.c: In destructor ‘virtual cThread::~cThread()’:
lib/thread.c:73:3: error: ‘pthread_attr_destroy’ was not declared in this scope; did you mean ‘pthread_attr_t’? 73 | pthread_attr_destroy(&attr); | ^~~~~~~~~~~~~~~~~~~~ | pthread_attr_t
lib/thread.c: In member function ‘bool cThread::Start(int, int)’:
lib/thread.c:166:18: error: ‘pthread_create’ was not declared in this scope; did you mean ‘timer_create’? 166 | res = pthread_create(&childTid, 0, (void*(*)(void*))&StartThread, (void*)this); | ^~~~~~~~~~~~~~ | timer_create
lib/thread.c:170:12: error: ‘pthread_attr_setstacksize’ was not declared in this scope 170 | pthread_attr_setstacksize(&attr, stackSize); | ^~~~~~~~~~~~~~~~~~~~~~~~~
lib/thread.c:171:18: error: ‘pthread_create’ was not declared in this scope; did you mean ‘timer_create’? 171 | res = pthread_create(&childTid, &attr, (void*(*)(void*))&StartThread, (void*)this); | ^~~~~~~~~~~~~~ | timer_create
lib/thread.c:176:12: error: ‘pthread_detach’ was not declared in this scope; did you mean ‘pthread_t’? 176 | pthread_detach(childTid); // auto-reap | ^~~~~~~~~~~~~~ | pthread_t
lib/thread.c: In member function ‘void cThread::Cancel(int)’:
lib/thread.c:230:6: error: ‘pthread_cancel’ was not declared in this scope; did you mean ‘pthread_once_t’? 230 | pthread_cancel(childTid); | ^~~~~~~~~~~~~~ | pthread_once_t
lib/thread.c: In constructor ‘cCondWait::cCondWait()’:
lib/thread.c:248:4: error: ‘pthread_mutex_init’ was not declared in this scope; did you mean ‘pthread_mutex_t’? 248 | pthread_mutex_init(&mutex, NULL); | ^~~~~~~~~~~~~~~~~~ | pthread_mutex_t
lib/thread.c:249:4: error: ‘pthread_cond_init’ was not declared in this scope; did you mean ‘pthread_cond_t’? 249 | pthread_cond_init(&cond, NULL); | ^~~~~~~~~~~~~~~~~ | pthread_cond_t
lib/thread.c: In destructor ‘cCondWait::~cCondWait()’:
lib/thread.c:254:4: error: ‘pthread_cond_broadcast’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 254 | pthread_cond_broadcast(&cond); // wake up any sleepers | ^~~~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c:255:4: error: ‘pthread_cond_destroy’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 255 | pthread_cond_destroy(&cond); | ^~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c:256:4: error: ‘pthread_mutex_destroy’ was not declared in this scope; did you mean ‘pthread_mutexattr_t’? 256 | pthread_mutex_destroy(&mutex); | ^~~~~~~~~~~~~~~~~~~~~ | pthread_mutexattr_t
lib/thread.c: In member function ‘bool cCondWait::Wait(int)’:
lib/thread.c:267:4: error: ‘pthread_mutex_lock’ was not declared in this scope; did you mean ‘pthread_mutex_t’? 267 | pthread_mutex_lock(&mutex); | ^~~~~~~~~~~~~~~~~~ | pthread_mutex_t
lib/thread.c:279:20: error: ‘pthread_cond_timedwait’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 279 | if (pthread_cond_timedwait(&cond, &mutex, &abstime) == ETIMEDOUT) | ^~~~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c:285:10: error: ‘pthread_cond_wait’ was not declared in this scope; did you mean ‘pthread_cond_t’? 285 | pthread_cond_wait(&cond, &mutex); | ^~~~~~~~~~~~~~~~~ | pthread_cond_t
lib/thread.c:290:4: error: ‘pthread_mutex_unlock’ was not declared in this scope; did you mean ‘pthread_mutex_t’? 290 | pthread_mutex_unlock(&mutex); | ^~~~~~~~~~~~~~~~~~~~ | pthread_mutex_t
lib/thread.c: In member function ‘void cCondWait::Signal()’:
lib/thread.c:297:4: error: ‘pthread_mutex_lock’ was not declared in this scope; did you mean ‘pthread_mutex_t’? 297 | pthread_mutex_lock(&mutex); | ^~~~~~~~~~~~~~~~~~ | pthread_mutex_t
lib/thread.c:299:4: error: ‘pthread_cond_broadcast’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 299 | pthread_cond_broadcast(&cond); | ^~~~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c:300:4: error: ‘pthread_mutex_unlock’ was not declared in this scope; did you mean ‘pthread_mutex_t’? 300 | pthread_mutex_unlock(&mutex); | ^~~~~~~~~~~~~~~~~~~~ | pthread_mutex_t
lib/thread.c: In constructor ‘cCondVar::cCondVar()’:
lib/thread.c:309:4: error: ‘pthread_cond_init’ was not declared in this scope; did you mean ‘pthread_cond_t’? 309 | pthread_cond_init(&cond, 0); | ^~~~~~~~~~~~~~~~~ | pthread_cond_t
lib/thread.c: In destructor ‘cCondVar::~cCondVar()’:
lib/thread.c:314:4: error: ‘pthread_cond_broadcast’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 314 | pthread_cond_broadcast(&cond); // wake up any sleepers | ^~~~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c:315:4: error: ‘pthread_cond_destroy’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 315 | pthread_cond_destroy(&cond); | ^~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c: In member function ‘void cCondVar::Wait(cMyMutex&)’:
lib/thread.c:325:7: error: ‘pthread_cond_wait’ was not declared in this scope; did you mean ‘pthread_cond_t’? 325 | pthread_cond_wait(&cond, &Mutex.mutex); | ^~~~~~~~~~~~~~~~~ | pthread_cond_t
lib/thread.c: In member function ‘bool cCondVar::TimedWait(cMyMutex&, int)’:
lib/thread.c:347:14: error: ‘pthread_cond_timedwait’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 347 | if (pthread_cond_timedwait(&cond, &Mutex.mutex, &abstime) == ETIMEDOUT) | ^~~~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
lib/thread.c: In member function ‘void cCondVar::Broadcast()’:
lib/thread.c:359:4: error: ‘pthread_cond_broadcast’ was not declared in this scope; did you mean ‘pthread_condattr_t’? 359 | pthread_cond_broadcast(&cond); | ^~~~~~~~~~~~~~~~~~~~~~ | pthread_condattr_t
make: *** [Make.config:110: lib/thread.o] Fehler 1
Alles anzeigen