Menu

pthread [Linker error] undefined reference to

2004-12-30
2012-09-26
  • Nobody/Anonymous

    when compile dev-c++ return
    [Linker error] undefined reference to _imp__pthread_create' [Linker error] undefined reference to_imp__pthread_join'

    i check with 3 programs, but all said the same
    i search in the web but nothing....
    then look at in this forum and again nothing

    what`s can i do?

     
    • they come

      they come - 2005-01-08

      thanks for your help , but i found the error, i dont have the direction of pthreads library

      those steps are:
      1 download the devpak
      2 run the devpak
      3 go to the tool then compiler option and put -lpthreadGC

      then just compile your program

      p.d: in www dont exist this installation for dev-c++ 4.9.9.0

       
      • doomstar

        doomstar - 2008-01-07

        I have Dev-Cpp version 4.9.9.2 and lib Pthreads-w32 version 2.8.0.

        And now, it seems to be -lpthreadGC2 instead of -lpthreadGC

        So, to make it run correctly : In "Outils" > "Option du compilateur" > check "Ajouter ces commandes lors de l'appel à l'éditeur de liens" > and add '-lpthreadGC2' (without cotes) in the field.

        Sorry for the french touch !

        Hope it will help you !

        keyword for bot referencement : Dev-C++ DevCpp Dev-Cpp pthread posix thread
        "[Linker error] undefined reference to `_imp__pthread_create'"

         
        • cpns

          cpns - 2008-01-07

          Why are you answering a question that was originally posted three years ago!?

          Moreover, your answer, while it may work, is not the best way of fixing the problem. It is bad as well as late advice! There is a separate box in the project settings dialog for linker options. That way the library is applied only to projects that need it, and the dependency is retained with the project.

          Clifford

           
    • Nobody/Anonymous

      It means you have someones private include file or library missing. Is there any reference to a DLL in your code?

      Ulrike

       
    • Nobody/Anonymous

      If that problem is not solved with the message above, try this.

      Check "Directories" under "Compiler Options" in the "Tools" menu. The paths must lead to folders inside the installation folder. I recently noticed that the paths I had pointed to a wrong folder from a previous installation and that was the reason why I was having that failure.

      Also, I heard that if the path to the installation folder cannot have spaces, or else it will crash.

       
    • Wayne Keen

      Wayne Keen - 2005-01-02

      Posting your full log would be a LOT better than just excepting the errors. This sort of error message is generally the result of not linking the right library, which the compile log will tell us about. Remember, linking a library is not just a matter of having the library in the right path, you have to issue the command to link it.

      Its on the tab labeled "Compile Log", and the right mouse button brings up the copy menu - if you have a ton of errors, start at the beginning and go through the first 5 or so errors.

      Wayne

       
    • Wayne Keen

      Wayne Keen - 2005-01-08

      Note if you start using a project, you will need to add your link command to the projects commands.

      4.9.9.1 is the current baseline, it can be found here:

      http://www.bloodshed.net/dev/devcpp.html

      Wayne

       
    • they come

      they come - 2005-01-08

      ok , but now I have a question
      exist some type a conflict between allegro and pthread?

      include <allegro.h>

      include <pthread.h>

      error in window.h (something like that ) and pthread.h

      include <pthread.h>

      include <allegro.h>

      error in allegro.h

      mi program is blank only a main and not exist function about allegro or pthread

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.