Thread: Extremely odd cout/pthread bug!

  1. #16
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Quote Originally Posted by Codeplug View Post
    I just ran that and updated my MSYS environment to the latest. Then copied the code in post #1 into main.cpp. Then:
    Code:
    $ g++ -Wall -O0 -g3 main.cpp -lpthread
    
    $ a.exe | tail
    main.cpp:24
    trial 96
    main.cpp:24
    trial 97
    main.cpp:24
    trial 98
    main.cpp:24
    trial 99
    main.cpp:24
    done!
    Same result if I compile and run outside of MSYS - runs to 99 every time.

    Do you have any other versions of MinGW installed that aren't in C:\MinGW?

    Your PATH environment variable should have "C:\MinGW\Bin" at the front of the PATH string.

    You may need to uninstall anything with "MinGW" in it from control panel. Then delete C:\MinGW completely (plus any other MinGW installs). Then re-install.

    gg

  2. #17
    Registered User
    Join Date
    May 2004
    Posts
    73
    Just checked my path, it's just C:\MinGW\bin (it's not at the front though).

    I just reinstalled MinGW and eclipse, but it's still happening.

    Since it didn't happen on your computer, and we're running the same versions of mingw, it makes me wonder, what could it be? The pthread lib comes with mingw, so they can't be different... I wonder, if we compare the outputs of the compiler, should they be identical?

  3. #18
    Registered User
    Join Date
    May 2004
    Posts
    73
    I just tried running it outside of eclipse, and it worked! On top of that, if I Run from inside eclipse instead of Debug (which I've been doing) then it works. Perhaps I should have tried that sooner.

    Does this mean it's a bug in GDB? Can someone else try running it in the debugger? If someone can reproduce it, then I can file a bug.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need help on this extremely harsh and tricky c++
    By kingkobra in forum C++ Programming
    Replies: 5
    Last Post: 12-05-2009, 01:00 PM
  2. extremely confused
    By hockey1 in forum C Programming
    Replies: 9
    Last Post: 04-24-2009, 11:36 AM
  3. something extremely wierd
    By nerdykid in forum C++ Programming
    Replies: 3
    Last Post: 11-04-2007, 10:14 AM
  4. extremely simple help
    By C++idiot in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2007, 10:39 AM
  5. Whats the difference between cout and std::cout?
    By mdshort in forum C++ Programming
    Replies: 10
    Last Post: 12-30-2003, 05:34 PM