Skip to content

Failed to compile on Mac OSX, g++ Apple LLVM version 7.0.2 (clang-700.1.81) #6

@sfchen

Description

@sfchen

g++ -g -O3 -Wall -std=c++14 -lpthread -ltbb read.cpp hash.cpp compress.cpp fqreader.cpp decompress.cpp main.cpp -o astrie
In file included from read.cpp:7:
./read.hpp:30:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
In file included from read.cpp:9:
./fqreader.hpp:52:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t read_access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
read.cpp:14:2: error: use of undeclared identifier 'pthread_spin_init'; did you mean 'pthread_cond_init'?
pthread_spin_init(&access, 0);
^~~~~~~~~~~~~~~~~
pthread_cond_init
/usr/include/pthread.h:285:5: note: 'pthread_cond_init' declared here
int pthread_cond_init(pthread_cond_t * __restrict,
^
read.cpp:14:20: error: cannot initialize a parameter of type 'pthread_cond_t *' (aka '_opaque_pthread_cond_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_init(&access, 0);
^~~~~~~
/usr/include/pthread.h:285:50: note: passing argument to parameter here
int pthread_cond_init(pthread_cond_t * __restrict,
^
read.cpp:20:2: error: use of undeclared identifier 'pthread_spin_init'; did you mean 'pthread_cond_init'?
pthread_spin_init(&access, 0);
^~~~~~~~~~~~~~~~~
pthread_cond_init
/usr/include/pthread.h:285:5: note: 'pthread_cond_init' declared here
int pthread_cond_init(pthread_cond_t * __restrict,
^
read.cpp:20:20: error: cannot initialize a parameter of type 'pthread_cond_t *' (aka '_opaque_pthread_cond_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_init(&access, 0);
^~~~~~~
/usr/include/pthread.h:285:50: note: passing argument to parameter here
int pthread_cond_init(pthread_cond_t * __restrict,
^
read.cpp:27:2: error: use of undeclared identifier 'pthread_spin_init'; did you mean 'pthread_cond_init'?
pthread_spin_init(&access, 0);
^~~~~~~~~~~~~~~~~
pthread_cond_init
/usr/include/pthread.h:285:5: note: 'pthread_cond_init' declared here
int pthread_cond_init(pthread_cond_t * __restrict,
^
read.cpp:27:20: error: cannot initialize a parameter of type 'pthread_cond_t *' (aka '_opaque_pthread_cond_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_init(&access, 0);
^~~~~~~
/usr/include/pthread.h:285:50: note: passing argument to parameter here
int pthread_cond_init(pthread_cond_t * __restrict,
^
read.cpp:31:2: error: use of undeclared identifier 'pthread_spin_lock'; did you mean 'pthread_mutex_lock'?
pthread_spin_lock(&access);
^~~~~~~~~~~~~~~~~
pthread_mutex_lock
/usr/include/pthread.h:356:5: note: 'pthread_mutex_lock' declared here
int pthread_mutex_lock(pthread_mutex_t *);
^
read.cpp:31:20: error: cannot initialize a parameter of type 'pthread_mutex_t *' (aka '_opaque_pthread_mutex_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_lock(&access);
^~~~~~~
/usr/include/pthread.h:356:41: note: passing argument to parameter here
int pthread_mutex_lock(pthread_mutex_t *);
^
read.cpp:33:2: error: use of undeclared identifier 'pthread_spin_unlock'; did you mean 'pthread_mutex_unlock'?
pthread_spin_unlock(&access);
^~~~~~~~~~~~~~~~~~~
pthread_mutex_unlock
/usr/include/pthread.h:366:5: note: 'pthread_mutex_unlock' declared here
int pthread_mutex_unlock(pthread_mutex_t *);
^
read.cpp:33:22: error: cannot initialize a parameter of type 'pthread_mutex_t *' (aka '_opaque_pthread_mutex_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_unlock(&access);
^~~~~~~
/usr/include/pthread.h:366:43: note: passing argument to parameter here
int pthread_mutex_unlock(pthread_mutex_t *);
^
read.cpp:47:2: error: use of undeclared identifier 'pthread_spin_lock'; did you mean 'pthread_mutex_lock'?
pthread_spin_lock(&access);
^~~~~~~~~~~~~~~~~
pthread_mutex_lock
/usr/include/pthread.h:356:5: note: 'pthread_mutex_lock' declared here
int pthread_mutex_lock(pthread_mutex_t *);
^
read.cpp:47:20: error: cannot initialize a parameter of type 'pthread_mutex_t *' (aka '_opaque_pthread_mutex_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_lock(&access);
^~~~~~~
/usr/include/pthread.h:356:41: note: passing argument to parameter here
int pthread_mutex_lock(pthread_mutex_t *);
^
read.cpp:55:2: error: use of undeclared identifier 'pthread_spin_unlock'; did you mean 'pthread_mutex_unlock'?
pthread_spin_unlock(&access);
^~~~~~~~~~~~~~~~~~~
pthread_mutex_unlock
/usr/include/pthread.h:366:5: note: 'pthread_mutex_unlock' declared here
int pthread_mutex_unlock(pthread_mutex_t *);
^
read.cpp:55:22: error: cannot initialize a parameter of type 'pthread_mutex_t *' (aka '_opaque_pthread_mutex_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_unlock(&access);
^~~~~~~
/usr/include/pthread.h:366:43: note: passing argument to parameter here
int pthread_mutex_unlock(pthread_mutex_t *);
^
16 errors generated.
In file included from hash.cpp:5:
In file included from ./hash.hpp:8:
./read.hpp:30:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
1 error generated.
In file included from compress.cpp:6:
./read.hpp:30:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
1 error generated.
In file included from fqreader.cpp:14:
In file included from ./hash.hpp:8:
./read.hpp:30:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
In file included from fqreader.cpp:17:
./fqreader.hpp:52:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t read_access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
fqreader.cpp:280:4: warning: format specifies type 'unsigned long' but the argument has type 'pthread_t' (aka '_opaque_pthread_t *') [-Wformat]
pthread_self());
^~~~~~~~~~~~~~
fqreader.cpp:297:56: warning: format specifies type 'unsigned long' but the argument has type 'pthread_t' (aka '_opaque_pthread_t *') [-Wformat]
printf("Read Connection completed by thread %lu.\n", pthread_self());
~~~ ^~~~~~~~~~~~~~
fqreader.cpp:309:4: warning: format specifies type 'unsigned long' but the argument has type 'pthread_t' (aka '_opaque_pthread_t *') [-Wformat]
pthread_self());
^~~~~~~~~~~~~~
fqreader.cpp:326:56: warning: format specifies type 'unsigned long' but the argument has type 'pthread_t' (aka '_opaque_pthread_t *') [-Wformat]
printf("Read Connection completed by thread %lu.\n", pthread_self());
~~~ ^~~~~~~~~~~~~~
fqreader.cpp:338:4: warning: format specifies type 'unsigned long' but the argument has type 'pthread_t' (aka '_opaque_pthread_t *') [-Wformat]
pthread_self());
^~~~~~~~~~~~~~
fqreader.cpp:375:56: warning: format specifies type 'unsigned long' but the argument has type 'pthread_t' (aka '_opaque_pthread_t *') [-Wformat]
printf("Read Connection completed by thread %lu.\n", pthread_self());
~~~ ^~~~~~~~~~~~~~
fqreader.cpp:392:2: error: use of undeclared identifier 'pthread_spin_init'; did you mean 'pthread_cond_init'?
pthread_spin_init(&read_access, 0);
^~~~~~~~~~~~~~~~~
pthread_cond_init
/usr/include/pthread.h:285:5: note: 'pthread_cond_init' declared here
int pthread_cond_init(pthread_cond_t * __restrict,
^
fqreader.cpp:392:20: error: cannot initialize a parameter of type 'pthread_cond_t *' (aka '_opaque_pthread_cond_t *') with an rvalue of type 'pthread_rwlock_t *' (aka '_opaque_pthread_rwlock_t *')
pthread_spin_init(&read_access, 0);
^~~~~~~~~~~~
/usr/include/pthread.h:285:50: note: passing argument to parameter here
int pthread_cond_init(pthread_cond_t * __restrict,
^
6 warnings and 4 errors generated.
In file included from decompress.cpp:6:
In file included from ./compress.hpp:9:
./read.hpp:30:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
1 error generated.
In file included from main.cpp:4:
In file included from ./fqreader.hpp:11:
In file included from ./hash.hpp:8:
./read.hpp:30:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
In file included from main.cpp:4:
./fqreader.hpp:52:2: error: unknown type name 'pthread_spinlock_t'; did you mean 'pthread_rwlock_t'?
pthread_spinlock_t read_access;
^~~~~~~~~~~~~~~~~~
pthread_rwlock_t
/usr/include/sys/_pthread/_pthread_rwlock_t.h:30:35: note: 'pthread_rwlock_t' declared here
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
^
2 errors generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions