Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:40:17+00:00 2026-06-13T09:40:17+00:00

This is a simple code which I have written to learn multi threaded programming

  • 0

This is a simple code which I have written to learn multi threaded programming on a Windows 7 OS in eclipse.

pthread_mutex_t double_release_001_glb_mutex_;
pthread_mutex_t * double_release_001_glb_mutex = & double_release_001_glb_mutex_;

void double_release_001_glb_mutex_lock () {}
void double_release_001_glb_mutex_unlock () {}

int double_release_001_glb_data = 0;

void * double_release_001_tsk_001 (void * pram)
{

    pthread_mutex_lock (double_release_001_glb_mutex);
    double_release_001_glb_data = (double_release_001_glb_data% 100) + 1;

    pthread_mutex_unlock (double_release_001_glb_mutex);
    return NULL;
}

void double_release_001 ()
{
    pthread_t tid1;
    pthread_mutex_init (double_release_001_glb_mutex, NULL);
    pthread_create (& tid1, NULL, double_release_001_tsk_001, NULL);
    pthread_join (tid1, NULL);
    pthread_mutex_destroy (double_release_001_glb_mutex);
}

void double_release_001_tskentry_001 ()
{
    while (1)
    {
        if (rand ())
        {
            double_release_001_tsk_001 (NULL);
        }
    }
}

But when I build it I get an error saying

Description Resource    Path    Location    Type
undefined reference to `_imp__pthread_create'   
undefined reference to `_imp__pthread_create'       
undefined reference to `_imp__pthread_create'   
undefined reference to `_imp__pthread_create'

I have included pthread.h. Can someone help me out here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:40:18+00:00Added an answer on June 13, 2026 at 9:40 am

    Add this option to the linker: -lpthread

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written this code which is simple #include <stdio.h> #include <string.h> void printLastLetter(char
i have this simple question please. I have this part of code which sets
I have written some code which produces simple animations based on cycling through a
I have written this code which accesses the Delete method on Web Service x,
I have written the following simple C code, which compiles and runs fine. However
I have written a short simple Jquery animation code. Which takes the rel attribute
I am trying to run this seemingly simple piece of code which is repeated
Which method is very effective and simple to code to attain this functionality ?
I have this simple code (for making things shorted, the important bits are probably
I have this simple code, using Joda-time. Works fine, but I have a problem.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.