Thread: ThreadMentor

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    149
    Rep Power
    36

    ThreadMentor


    I'm trying to get a head start on the rest of my concurrent computing course by getting familiar with ThreadMentor, available here , but I'm having some trouble getting it to work. My professor is one of the authors, but he has a habit of ignoring or deflecting both my emails and questions in class.

    What I'm working with at home:
    Windows 7 Professional 64-bit
    Visual Studio 2010

    I've followed the directions in item #7 here

    However, when I try to build the "Smoker's Problem" project available here

    I get the following linker errors:

    Error 1 error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClass.obj) threadMentorTest

    Error 2 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

    Error 3 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadIdMapTable.obj) threadMentorTest

    Error 4 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClassException.obj) threadMentorTest

    Error 5 error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) referenced in function "protected: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClass.obj) threadMentorTest

    Error 6 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

    Error 7 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadIdMapTable.obj) threadMentorTest

    Error 8 error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(ThreadClassException.obj) threadMentorTest

    Error 9 error LNK2019: unresolved external symbol "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPAV123@@Z) referenced in function "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

    Error 10 error LNK2001: unresolved external symbol "long const std::_BADOFF" (?_BADOFF@std@@3JB) C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\threadMentorTest\ThreadClass.lib(mtuStrstream.obj) threadMentorTest

    Error 11 error LNK1120: 4 unresolved externals C:\Users\Anthony\Documents\Visual Studio 2010\Projects\threadMentorTest\Debug\threadMentorTest.exe threadMentorTest
    I did manage to catch up with him after class today and explained my problem. He seems to think that it is because I'm using a 64-bit OS, or at least that was my interpretation of what he said. He also has an unfortunate habit of misinterpreting things that I say, and completely missing the point, so is ThreadMentor just not compatible with my environment or is there some extra steps I need to take?

    I'm thinking there might be something else I need to do, or do differently, since his directions are for Visual Studio 2005, and I'm using Visual Studio 2010. I appreciate any confirmation of my professor's statements, or tips on how to get this to work on my home machine.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    187
    Rep Power
    82
    It looks like it may be a linker issue. Do you have ThreadClass.lib on your machine? If so, can VS 2010 find it?

    Category: Linker / Input
    Option: Additional Dependencies
    Value: ThreadClass.lib
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    149
    Rep Power
    36
    Yes, I did download ThreadClass.lib and followed the instructions I said I followed. Yes, I made sure the paths I input in those directions were correct. As to whether or not Visual Studio can find ThreadClass.lib, I don't know but I do know it is on my machine and that I gave the paths correctly in the directions.

    Have you tried and successfully built one of the ThreadMentor tutorial projects in a similar environment, or are you just guessing at the problem?
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    149
    Rep Power
    36
















    Is what I have done. If anyone sees anything I did wrong according to the directions, please let me know. If you can think of anything ELSE I might need to do, that would be great.
    Attached Images
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    187
    Rep Power
    82
    Have you tried and successfully built one of the ThreadMentor tutorial projects in a similar environment, or are you just guessing at the problem?
    Initially, I just took an educated guess.

    so is ThreadMentor just not compatible with my environment or is there some extra steps I need to take?
    But later, I tried to compile the example and received the same messages. So, I used DumpBin to look at the details of the ThreadClass.lib. They are as follows:

    Executing Dumpbin Threadclass.lib /Headers produces the following output:
    Code:
    Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file Threadclass.lib
    
    File Type: LIBRARY
    
    FILE HEADER VALUES
                 14C machine (x86)
                 37E number of sections
            4512CE17 time date stamp Thu Sep 21 13:38:31 2006
               38C11 file pointer to symbol table
                 A94 number of symbols
                   0 size of optional header
                   0 characteristics
    The machine parm indicates that it is a 32 bit lib file. The Application Binary Interface (ABI) of a 32 bit and a 64 bit lib file are totally incompatible making it impossible to use a 32 bit lib in a 64 bit environment.

    Comments on this post

    • jakotheshadows agrees : Thanks. Now I know.
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    149
    Rep Power
    36
    I guess the lab machines at school must use a 32-bit Linux, probably because nobody has made a 64-bit version of this particular library that CS majors must use for this required course.

    But if that were the case how was I able to do stuff with x86-64 assembler on the lab machines last semester, wouldn't I need to use a 64-bit Linux to do such a thing? Or is Linux somehow different?

    Or maybe it doesn't actually work on the lab machines either :confused:
    Last edited by jakotheshadows; March 5th, 2013 at 08:39 PM.
  12. #7
  13. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,379
    Rep Power
    1871
    Hidden somewhere away under the control of the tutor, there will be a ThreadClass.cpp file used to generate a ThreadClass.lib

    Being source code, it would be possible to generate
    ThreadClass.lib for x86, 32-bit code for Windows
    ThreadClass.lib for x86-64, 64-bit code for Windows
    ThreadClass.lib for x86-64, 64-bit code for Linux
    ThreadClass.lib for x86, 32-bit code for Linux

    It really doesn't matter which architecture the lab machine is, it will have a compatible lib built for it.

    The problem for you is that the one you need doesn't exist.

    Whether your tutor wants to spend time making the version you want is something you need to discuss with them. But perhaps you could point out to them that you may be the first to want a 64-bit version, but you sure won't be the last.

    You're fortunate enough to end up in a fairly enlightened college where different compilers are supported, and perhaps even encouraged. It's the poor souls who have now resort to running TurboC in DosBox who are really being screwed over.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  14. #8
  15. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    149
    Rep Power
    36
    Originally Posted by salem
    It's the poor souls who have now resort to running TurboC in DosBox who are really being screwed over.
    LOL, where do they do this, in India?

    Well, different compilers aren't discouraged, but whenever we submit code it has to work on the lab machines and it has to compile with the compiler the graders will use.

    It would be nice to be able to get my code "conceptually done" at home with a nice IDE and GUI debugger before going back to the good 'ol Linux command line.
    Last edited by jakotheshadows; March 6th, 2013 at 08:33 AM.
  16. #9
  17. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    Originally Posted by BobS0327
    it impossible to use a 32 bit lib in a 64 bit environment.
    It is not about the environment, it is about the build - you cannot link a 32 bit library to 64 bit code perhaps, but I don't believe that stops you building and executing 32 bit code in a 64 bit
    Last edited by clifford; March 6th, 2013 at 09:38 AM.
  18. #10
  19. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    149
    Rep Power
    36
    Originally Posted by clifford
    It is not about the environment, it is about the build - you cannot link a 32 bit library to 64 bit code perhaps, but I don't believe that stops you building and executing 32 bit code in a 64 bit
    Do you mean I might be able to build the Smoker's Problem project as 32-bit code and that would solve the problem I'm having?

IMN logo majestic logo threadwatch logo seochat tools logo