From: "jefe goode" <jefe_goode@yahoo.com>
To: Mark Weaver <mark@npsl.co.uk>, pthreads-win32@sources.redhat.com
Subject: RE: pthread declaration problem
Date: Wed, 12 May 2004 00:37:00 -0000 [thread overview]
Message-ID: <20040512003731.20656.qmail@web61001.mail.yahoo.com> (raw)
In-Reply-To: <GFEPJIHHFOJDOFDMNAJDGEECIMAA.mark@npsl.co.uk>
Mark
Complete program below:
compiler output is 7 errors -- (all type info not
found -- the other 6 errors are knock-on ones )
C:\PROJECTS\CP3\Thread1\Thread1.cpp(22) : error C2065:
'pthread_t' : undeclared identifier
Regards and Thanks
Jefe
--------------- Listing below --------------
#include "Thread.h"
#include "pthread.h"
#include "sched.h"
#include "semaphore.h"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include "stdafx.h"
void print_message_function( void *ptr );
int main(int argc, char* argv[])
{
pthread_t thread1, thread2;
char *message1 = "Hello";
char *message2 = "World";
pthread_create( &thread1, pthread_attr_default,
(void*)&print_message_function,
(void*) message1);
pthread_create(&thread2, pthread_attr_default,
(void*)&print_message_function,
(void*) message2);
exit(0);
return 0;
}
void print_message_function( void *ptr )
{
char *message;
message = (char *) ptr;
printf("%s ", message);
}
--------- end listing -----------------
--- Mark Weaver <mark@npsl.co.uk> wrote: > >
> >
> > Thanks Mark,
> >
> > Yes, it fails to compile and #include "pthread.h"
> is
> > included;
> > pthread_t tid; //fails to compile
> >
> >
> Try posting the complete program together with the
> compiler output.
>
> Mark
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
next prev parent reply other threads:[~2004-05-12 0:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-11 22:11 jefe goode
2004-05-11 23:26 ` Mark Weaver
2004-05-12 0:13 ` jefe goode
2004-05-12 0:23 ` Mark Weaver
2004-05-12 0:37 ` jefe goode [this message]
2004-05-12 1:00 ` Mark Weaver
2004-05-11 22:11 jefe goode
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040512003731.20656.qmail@web61001.mail.yahoo.com \
--to=jefe_goode@yahoo.com \
--cc=mark@npsl.co.uk \
--cc=pthreads-win32@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).