Help with errors while compiling

Afflictedd2 edvelez.g@gmail.com
Mon Dec 7 20:12:00 GMT 2009


Hi everyone,

I'm trying to build a simple program using pthreads, but I get the following
errors, why?

Any help appreciated.
J

make -f Makefile CFG=Debug 
g++ -c   -g -o "Debug/Pthreads.o" -I/Cygwin/usr/include  Pthreads.cpp
In file included from Pthreads.cpp:10:
/Cygwin/usr/include/pthread.h:77: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:77: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:78: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:78: error: ISO C++ forbids declaration of
`pthread_attr_t' with no type
/Cygwin/usr/include/pthread.h:79: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:79: error: ISO C++ forbids declaration of
`pthread_attr_t' with no type
/Cygwin/usr/include/pthread.h:80: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:80: error: ISO C++ forbids declaration of
`pthread_attr_t' with no type
/Cygwin/usr/include/pthread.h:81: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:81: error: ISO C++ forbids declaration of
`pthread_attr_t' with no type
/Cygwin/usr/include/pthread.h:82: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:82: error: ISO C++ forbids declaration of
`pthread_attr_t' with no type
/Cygwin/usr/include/pthread.h:83: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:83: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:84: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:84: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:84: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:84: error: initializer expression list treated
as compound expression
/Cygwin/usr/include/pthread.h:85: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:85: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:85: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:85: error: initializer expression list treated
as compound expression
/Cygwin/usr/include/pthread.h:86: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:86: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:86: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:86: error: initializer expression list treated
as compound expression
/Cygwin/usr/include/pthread.h:87: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:87: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:87: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:87: error: initializer expression list treated
as compound expression
/Cygwin/usr/include/pthread.h:88: error: `pthread_attr_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:88: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:88: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:88: error: initializer expression list treated
as compound expression
/Cygwin/usr/include/pthread.h:104: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:127: error: `pthread_cond_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:127: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:128: error: `pthread_cond_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:128: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:129: error: `pthread_cond_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:129: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:129: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:129: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:130: error: `pthread_cond_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:130: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:131: error: `pthread_cond_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:131: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:132: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:132: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:132: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:132: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:133: error: `pthread_cond_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:133: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:133: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:133: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:133: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:134: error: `pthread_condattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:134: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:135: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:135: error: ISO C++ forbids declaration of
`pthread_condattr_t' with no type
/Cygwin/usr/include/pthread.h:136: error: `pthread_condattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:136: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:137: error: `pthread_condattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:137: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:137: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:137: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:139: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:139: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:139: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:140: error: expected primary-expression before
"void"
/Cygwin/usr/include/pthread.h:140: error: expected primary-expression before
"void"
/Cygwin/usr/include/pthread.h:140: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:141: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:142: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:142: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:142: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:144: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:144: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:144: error: expected primary-expression before
"struct"
/Cygwin/usr/include/pthread.h:144: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:145: error: `pthread_key_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:146: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:146: error: expected primary-expression before
"void"
/Cygwin/usr/include/pthread.h:146: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:147: error: `pthread_key_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:147: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:147: error: expected primary-expression before
"void"
/Cygwin/usr/include/pthread.h:147: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:148: error: `pthread_key_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:151: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:151: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:152: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:152: error: ISO C++ forbids declaration of
`pthread_mutex_t' with no type
/Cygwin/usr/include/pthread.h:153: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:153: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:153: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:153: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:154: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:154: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:155: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:155: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:155: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:155: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:155: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:156: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:156: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:157: error: `pthread_mutex_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:157: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:158: error: `pthread_mutexattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:158: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:159: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:159: error: ISO C++ forbids declaration of
`pthread_mutexattr_t' with no type
/Cygwin/usr/include/pthread.h:160: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:160: error: ISO C++ forbids declaration of
`pthread_mutexattr_t' with no type
/Cygwin/usr/include/pthread.h:161: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:161: error: ISO C++ forbids declaration of
`pthread_mutexattr_t' with no type
/Cygwin/usr/include/pthread.h:162: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:162: error: ISO C++ forbids declaration of
`pthread_mutexattr_t' with no type
/Cygwin/usr/include/pthread.h:163: error: `pthread_mutexattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:163: error: expected primary-expression before
')' token
/Cygwin/usr/include/pthread.h:164: error: `pthread_mutexattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:164: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:164: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:164: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:165: error: `pthread_mutexattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:165: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:165: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:165: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:166: error: `pthread_mutexattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:166: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:166: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:166: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:167: error: `pthread_mutexattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:167: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:167: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:167: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:170: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:170: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:171: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:171: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:171: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:171: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:172: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:172: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:173: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:173: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:174: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:174: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:175: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:175: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:176: error: `pthread_rwlock_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:176: error: `rwlock' was not declared in this
scope
/Cygwin/usr/include/pthread.h:177: error: `pthread_rwlockattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:177: error: `rwlockattr' was not declared in
this scope
/Cygwin/usr/include/pthread.h:178: error: expected `,' or `...' before '*'
token
/Cygwin/usr/include/pthread.h:179: error: ISO C++ forbids declaration of
`pthread_rwlockattr_t' with no type
/Cygwin/usr/include/pthread.h:180: error: `pthread_rwlockattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:180: error: `attr' was not declared in this
scope
/Cygwin/usr/include/pthread.h:180: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:180: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:181: error: `pthread_rwlockattr_t' was not
declared in this scope
/Cygwin/usr/include/pthread.h:181: error: `rwlockattr' was not declared in
this scope
/Cygwin/usr/include/pthread.h:183: error: `pthread_once_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:183: error: expected primary-expression before
',' token
/Cygwin/usr/include/pthread.h:183: error: expected primary-expression before
"void"
/Cygwin/usr/include/pthread.h:183: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:190: error: `pthread_t' does not name a type
/Cygwin/usr/include/pthread.h:193: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:193: error: expected primary-expression before
"int"
/Cygwin/usr/include/pthread.h:193: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:193: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:194: error: `pthread_key_t' was not declared
in this scope
/Cygwin/usr/include/pthread.h:194: error: expected primary-expression before
"const"
/Cygwin/usr/include/pthread.h:194: error: initializer expression list
treated as compound expression
/Cygwin/usr/include/pthread.h:199: error: `pthread_t' was not declared in
this scope
/Cygwin/usr/include/pthread.h:200: error: `pthread_t' was not declared in
this scope
Pthreads.cpp: In function `int main(int, char**)':
Pthreads.cpp:26: error: `pthread_t' undeclared (first use this function)
Pthreads.cpp:26: error: (Each undeclared identifier is reported only once
for each function it appears in.)
Pthreads.cpp:26: error: expected `;' before "threads"
Pthreads.cpp:32: error: `threads' undeclared (first use this function)
Pthreads.cpp:32: error: `pthread_create' cannot be used as a function
mingw32-make: *** [Debug/Pthreads.o] Error 1


-- 
View this message in context: http://old.nabble.com/Help-with-errors-while-compiling-tp26683356p26683356.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list