Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Pthread_rwlock_t data type declarations mistakes, how so? ?

This code is as follows :
#include<pthread.h>;
Pthread_rwlock_t lock;

Int main (void)
{
........
}

Compiler of "warning : data definition has no type or storage class" mistakes, which is how the case ah? How to solve this problem?
I use the RH9.0

Pthread_rwlock_t data type declarations mistakes, how so? ?

#include "Sys/types.h>;

Pthread_rwlock_t data type declarations mistakes, how so? ?

Pthread_rwlock_t data type declarations mistakes, how so? ?

You can add a compiler option -D__USE_UNIX98 try.
Zhushidiao they do not.

Pthread_rwlock_t data type declarations mistakes, how so? ?

-->

Thank you, Big Brother proposal lenovo
I understand that you had a trial, or not :
[code]gcc-C mc_daemon.c -I/usr/include/mysql -D__USE_UNIX98
Mc_daemon.c:19 : parse error before "rwstate"
Mc_daemon.c:19 : warning : data definition has no type or storage class
Make : *** 1 [mc_daemon.o] Error
[/code]

Pthread_rwlock_t data type declarations mistakes, how so? ?

Did you missed pulling the brackets. I was at the wrong committed and Latin America

Pthread_rwlock_t data type declarations mistakes, how so? ?

Pthread_rwlock_t data type declarations mistakes, how so? ?

Try to compile like this : gcc -o test test.c -D_XOPEN_SOURCE=500 -Wall. But not specified 't ask me why. I not specified 't know.

Pthread_rwlock_t data type declarations mistakes, how so? ?

Pthread_rwlock_t data type declarations mistakes, how so? ?

This shows you rwstate issues have been resolved, but there are other errors that the compiler told you slowly change bars.

Pthread_rwlock_t data type declarations mistakes, how so? ?

But it "the same code" ah, but the translation, a used-D option, a useless, and received two different results.

Pthread_rwlock_t data type declarations mistakes, how so? ?

-D_XOPEN_SOURCE=500 Increase after editing gives you the above procedures have been no problem. For your own procedures, not code stickers out, I am afraid no one knew how to solve them.



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com