Subj : _beginthread / _endthread To : borland.public.cpp.borlandcpp From : M. Finch Date : Mon Sep 06 2004 10:53 pm Well, I'm REALLY confused on this one. I'm taking code directly from the Borland help file and it doesn't link. I'm trying to start a separate thread in my program. Here are the specifics: XP, AMD3000+, BC++ 5.02, GUI for compile and link. I WANT to do this with C++, but I'm trying it with C to figure how to do it correctly first. I get the following errors: Unresolved external '__threadid' Unresolved external '__endthread' Unresolved external '__beginthread' Here is the code from the help file: #include #include #include /* _threadid variable */ #include /* _beginthread, _endthread */ #include /* time, _ctime */ void thread_code(void *threadno) { time_t t; time(&t); printf("Executing thread number %d, ID = %d, time = %s\n", (int)threadno, _threadid, ctime(&t)); _endthread(); } void start_thread(int i) { int thread_id; #if defined(__WIN32__) if ((thread_id = _beginthread(thread_code,4096,(void *)i)) == (unsigned long)-1) #else if ((thread_id = _beginthread(thread_code,4096,(void *)i)) == -1) #endif { printf("Unable to create thread %d, errno = %d\n",i,errno); return; } printf("Created thread %d, ID = %ld\n",i,thread_id); } int main(void) { int i; for (i = 1; i < 20; i++) start_thread(i); printf("Hit ENTER to exit main thread.\n"); getchar(); return 0; } Any help would be appreciated. I'll bet there's a better, newer way of doing threads, but this has me stumped!! mfinch .